 Jnoid.fromDOM = ($, e)->
 
 Jnoid.fromList = (list)->
-  new EventStream( (sink)->
-    schedule = (xs) ->
-      if empty xs
-        sink Jnoid.end()
-      else
-        push xs
-    push = (xs) ->
-      reply = sink Jnoid.next head xs
-      unless reply == Jnoid.noMore
-        schedule tail xs
-    schedule list
-  )
+  new EventStream(sendWrapped(list, toEvent))
+
+sendWrapped = (values, wrapper) ->
+  (sink) ->
+    sink (wrapper value) for value in values
+    sink (Jnoid.end())
+    nop
 
 # Dummy objects for asserting.
 # Should not be equal.

  toEventStream: -> new EventStream(@subscribe)
  toString: -> "Dispatcher"

empty = (xs) -> xs.length == 0
head = (xs) -> xs[0]
tail = (xs) -> xs[1...xs.length]


Jnoid.end = -> new End()

class Event
  isEnd: -> false
  isInitial: -> false
  isNext: -> false
