 Bacon.Next = Next
 Bacon.End = End
 Bacon.Error = Error
+Bacon.None = None
+Bacon.Some = Some
 
 nop = ->
 latter = (_, x) -> x

Bacon.noMore = "veggies"

Bacon.more = "moar bacon!"
Bacon.none = {nothing: true}

Bacon.never = => new EventStream (sink) =>
  => nop

class PropertyDispatcher extends Dispatcher
  constructor: (subscribe, handleEvent) ->
    super(subscribe, handleEvent)
    current = Bacon.None
    push = @push
    subscribe = @subscribe
    @push = (event) =>
      if event.hasValue()
        current = new Some(event.value)
      push.apply(this, [event])
    @subscribe = (sink) =>
      reply = current.filter(@hasSubscribers).map((val) -> sink initial(val))
      if reply.getOrElse(Bacon.more) == Bacon.noMore
        nop
      else
        subscribe.apply(this, [sink])

class Bus extends EventStream
  constructor: ->
