anchor.diff:       | Finished 
   
     let collect (f: 'T -> AsyncSeq<'U>) (inp: AsyncSeq<'T>) : AsyncSeq<'U> = 
  -        // Note: this is put outside the object deliberately, so the object doesn't permanently capture inp1 and inp2
  -        let initialState = NotStarted inp
           { new IAsyncEnumerable<'U> with 
                 member x.GetEnumerator() = 
  -                  let state = ref initialState
  +                  let state = ref (CollectState.NotStarted inp)
                     { new IAsyncEnumerator<'U> with 
                           member x.MoveNext() = 
                               async { match !state with 
  -                                    | NotStarted inp -> 
  +                                    | CollectState.NotStarted inp -> 
                                           return! 
                                              (let e1 = inp.GetEnumerator()
  -                                            state := HaveInputEnumerator e1
  +                                            state := CollectState.HaveInputEnumerator e1
                                               x.MoveNext())
  -                                    | HaveInputEnumerator e1 ->   
  +                                    | CollectState.HaveInputEnumerator e1 ->   
                                           let! res1 = e1.MoveNext() 
                                           return! 
                                              (match res1 with
                                               | Some v1 ->
                                                   let e2 = (f v1).GetEnumerator()
  -                                                state := HaveInnerEnumerator (e1, e2)
  +                                                state := CollectState.HaveInnerEnumerator (e1, e2)
                                               | None -> 
                                                   x.Dispose()
                                               x.MoveNext())
  -                                    | HaveInnerEnumerator (e1, e2) ->   
  +                                    | CollectState.HaveInnerEnumerator (e1, e2) ->   
                                           let! res2 = e2.MoveNext() 
                                           match res2 with 
                                           | None ->
  -                                            state := HaveInputEnumerator e1
  +                                            state := CollectState.HaveInputEnumerator e1
                                               dispose e2
                                               return! x.MoveNext()
                                           | Some _ -> 
  
positive.code:                                         return None }
                          member x.Dispose() = 
                              match !state with 
                              | HaveInputEnumerator e1 -> 
                                  state := Finished
                                  dispose e1 
                              | HaveInnerEnumerator (e1, e2) -> 
                                  state := Finished
                                  dispose e2
                                  dispose e1 
                              | _ -> () } }
  
    type CollectSeqState<'T,'U> =
       | NotStarted    of seq<'T>
       | HaveInputEnumerator of IEnumerator<'T>
  
negative.code:                                                       return (if res then Some v else None) }
                          member x.Dispose() = () } }
      
    [<RequireQualifiedAccess>]
    type AppendState<'T> =
       | NotStarted1     of AsyncSeq<'T> * AsyncSeq<'T>
       | HaveEnumerator1 of IAsyncEnumerator<'T> * AsyncSeq<'T>
  