   isInitial: -> true
   isNext: -> false
   apply: (value) -> new Initial(value)
-  toNext: ->
-    if @valueInternal
-      new Next(@valueInternal, true)
-    else
-      new Next(@value)
+  toNext: -> new Next(this)
 
 class End extends Event
   isEnd: -> true

class Next extends Event
  constructor: (valueF, eager) ->
    super()
    if isFunction(valueF) && !eager
      @valueF = valueF
      @valueInternal = undefined
    else

      @valueInternal = valueF
  isNext: -> true
  hasValue: -> true
  value: ->
    if @valueF instanceof Initial
      @valueInternal = @valueF.value()
      @valueF = undefined
    else if @valueF
      @valueInternal = @valueF()
      @valueF = undefined
    @valueInternal
  fmap: (f) ->
    if @valueInternal
      value = @valueInternal
      @apply(-> f(value))
    else
      event = this
      @apply(-> f(event.value()))
  apply: (value) -> new Next(value)
  filter: (f) -> f(@value())
  toString: -> _.toString(@value())
