     i = _.indexOf(xs, x)
     if i >= 0
       xs.splice(i, 1)
-  popHead: (xs) ->
-    xs.splice(0,1)[0]
   fold: (xs, seed, f) ->
     for x in xs
       seed = f(seed, x)

        else
          spawn event
    composite.unsubscribe
  extraDeps = []
  result.internalDeps = ->
    extraDeps.concat(root)
  result


class EventStream extends Observable
  constructor: (desc, subscribe) ->

          unsubAll() if reply == Bacon.noMore
          reply
    checkQueue = ->
      event = queue.splice(0,1)[0]
      spawn event if event
    checkEnd = (unsub) ->
      unsub()
