anchor.diff:  
       let maxValue : Time = DateTime.MaxValue
       let minValue : Time = DateTime.MinValue
  -
  -type EndReason =
  -    | Error of Exception
  -    | Finished
  -    | Continue
   
   type History<'a> = { values : list<Time * 'a>; finished : bool }
   
  
positive.code:         { values = List.map (fun (t,v) -> t, f v) h.values; finished = h.finished }      
  
  
  
  type IEventReader<'a> =
      inherit IAdaptiveObject
      inherit IDisposable
  
negative.code:             buffer <- History.empty
              remove x
  
      type WhileReader<'a>(guard : IMod<bool>, body : IEventReader<'a>) =
          inherit AbstractReader<'a>()
  
          let mutable guard = new ModReader<_>(guard) :> IEventReader<_>
          let mutable inner : IEventReader<'a> = null
          let mutable startTime = None
          let mutable endTime = None
  
  
          override x.IsFinished = Option.isSome endTime
  
          override x.ComputeHistory() =
              if not (isNull guard) then
                  let guardHistory = guard.GetHistory x
  
                  for (t,v) in guardHistory.values do
                      if v && Option.isNone startTime then
                          inner <- body
                          startTime <- Some t
                      elif not v && Option.isSome startTime then
                          guard.Outputs.Remove x |> ignore
                          guard.Dispose()
                          guard <- null
                          endTime <- Some t
  
              if isNull inner then
                  History.empty
              else
                  match startTime, endTime with
                      | Some st, Some et ->
                          let all = inner.GetHistory x 
                          inner.Outputs.Remove x |> ignore
                          inner.Dispose()
                          { values = List.filter (fun (t,_) -> t >= st && t <= et) all.values; finished = true}
                      | Some st, None ->
                          let all = inner.GetHistory x 
                          { all with values = List.filter (fun (t,_) -> t >= st) all.values }
                      | _ -> 
                          History.empty
  
          override x.Release() =
              if not (isNull inner) then inner.Dispose()
              if not (isNull guard) then guard.Dispose()
  
  
  
  
  