anchor.diff:  
   and [<AbstractClass>] GParser<'a> () = 
       inherit Unique()
  -    abstract member Chain : Trampoline<'a> * InputStream<'a> -> Continuation<'a> -> Trampoline<'a>
  +    abstract member Chain : InputStream<'a> -> Continuation<'a> -> PState<'a>
   
   and [<AbstractClass>] Parser<'a, 'r when 'r : equality> () = 
       inherit GParser<'a> ()
  
positive.code: 
          recprocess(left) @ recprocess(right)
      
      override this.Chain(t, inp) (f) = 
          let lst = gather.Value
          let invocation = (new Unique()).Uid
          lst 
          |> List.fold (fun t p -> 
              t.Add(p, inp) (Cont.New(fun (t, res) ->
                  let results = Map.find invocation t.DisjResults
                  if results.Contains (res) then t
                  else { f.F (t, res) with 
                          DisjResults = t.DisjResults.Add(invocation, results.Add(res)) }
              ))
          ) { t with DisjResults = t.DisjResults.Add(invocation, Set.empty) }
      
  and Trampoline<'a> = { 
      // R
      Queue: (GParser<'a> * InputStream<'a>) list
  
negative.code:     Successes: SSet<'a>
      Failures: SSet<'a>
      Postrace: string list
      DisRes: Map<int, SSet<'a> >
  } 
  and T () =
       
      static member AddResult<'a> (r: GParserResult<'a>) : PState<'a> = 
          getState >>= fun t ->
              putState <| if r.Succeeded then { t with Successes = t.Successes.Add(r) }
                                         else { t with Failures = t.Failures.Add(r) }
  
      static member Run<'a> () : PState<'a> = state { 
          let! t = getState
          if not (List.isEmpty t.Queue || t.Stopped) then
              do! T.Step ()
              return! T.Run ()
      }
           
      static member Stop<'a> () : PState<'a> = modify (fun t -> { t with Stopped = true })
  
      static member Step<'a> () : PState<'a> = state { 
          let! t1 = getState
          let p, s = t1.Queue.Head
          do! modify (fun t -> { t with Queue = List.tail t.Queue })
          do! p.Chain (s) (Cont.New(fun res -> state {
              let! t = getState
              let popped =
                  let parsers = match t.Popped.TryFind(s) with | Some ps -> ps | _ -> Map.empty
                  let rset = match parsers.TryFind(p) with | Some rs -> rs 
                                                           | _ -> (if res.Succeeded then Set.singleton res else Set.empty)
                  t.Popped.Add(s, parsers.Add(p, rset))
  
              do! modify (fun t -> { t with Popped = popped })
              let! t = getState
              let links = t.Backlinks.[s].[p] |> Seq.toList
              // TODO OK  ???
              match t.Saved.TryFind(res) with
              | Some _ ->
                  for f in links do
                      let! t = getState
                      let set = t.Saved.[res]              // TODO CAN BE A BUG
                      if not (set.Contains(f)) then
                          do! modify (fun t -> { t with Saved = t.Saved.Add(res, set.Add f) })
                          do! res |> f.F
              | _ -> 
                  do! modify (fun t -> { t with Saved = t.Saved.Add (res, Set.empty) } )
                  for f in links do
                      let! t = getState
                      let set = t.Saved.[res]
                      do! modify (fun t -> { t with Saved = t.Saved.Add(res, set.Add f) }) 
                      do! res |> f.F
              }
          ))
          }
  
      static member Add<'a> (p: GParser<'a>, s: InputStream<'a>) (f: Continuation<'a>) : PState<'a> = state {
          let tuple = (p, s)
          let! t = getState
          let backlinks = 
              let parsers = match t.Backlinks.TryFind(s) with | Some ps -> ps | _ -> Map.empty
              let fset = match parsers.TryFind(p) with | Some fs -> fs | _ -> Set.singleton f
              t.Backlinks.Add(s, parsers.Add(p, fset))
          do! modify <| fun t -> { t with Backlinks = backlinks }
          let! t = getState
          match t.Popped.TryFind(s) with
          | Some parsers when parsers.ContainsKey p ->
              for res in parsers.[p] do
                  do! f.F (res) // if we've already done that, use the result
          | _ ->
              let parsers = match t.Done.TryFind(s) with | Some ps -> ps | _ -> Set.empty
              if not (parsers.Contains p) then 
                  do! modify (fun t -> { t with Queue = tuple :: t.Queue; Done = t.Done.Add(s, parsers.Add p) })
          }
  
  #nowarn "1189"
  
  let inline preturn<'a, 'r when 'r: equality> (a: 'r) : Parser<'a, 'r> = 
      { new TerminalParser<'a, 'r>() 
        with override this.Parse inp = success<'a, 'r> a inp } :> Parser<'a, 'r>
  
  let inline perror<'a, 'r when 'r: equality> (msg: string) : Parser<'a, 'r> = 
      { new TerminalParser<'a, 'r>() 
        with override this.Parse inp = failure<'a> msg inp } :> Parser<'a, 'r>
  
  let inline satisfy<'a when 'a: equality> (pred : 'a -> bool) = 
      { new TerminalParser<'a, 'a>() with 
        override this.Parse (s: InputStream<'a>) =
          if s.IsEmpty then failure<'a> "UnexpectedEOF" s
  