anchor.diff:  
                       /// Iterates backwards over the array elements, creating a chain of continuations
                       /// which'll process them in order (from left-to-right) when executed.
  -                    let rec buildFirstArgCont idx cont =
  +                    let rec buildCont idx cont =
                           // The first element needs to be handled specially.
                           if idx = 0 then
                               // Pass the initial state to the mapping function when processing the first element.
  
positive.code: 
  
  //
  [<RequireQualifiedAccess>]
  module Cps =
      //
  
negative.code:                 state <- state'
  
              results, state
  
  
  //
  [<RequireQualifiedAccess; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
  module Reader =
      /// The standard F# Array module, lifted into the Reader monad.
      [<RequireQualifiedAccess; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
      module Array =
          //
          [<CompiledName("Map")>]
          let map (mapping : 'T -> 'Env -> 'U) (array : 'T[]) (env : 'Env) : 'U[] =
              // Preconditions
              checkNonNull "array" array
  
              let mapping = FSharpFunc<_,_,_>.Adapt mapping
              let len = Array.length array
              /// Holds the mapped results.
              let results = Array.zeroCreate len
  
              for i = 0 to len - 1 do
                  results.[i] <- mapping.Invoke (array.[i], env)
              results
  
          //
          [<CompiledName("MapIndexed")>]
          let mapi (mapping : int -> 'T -> 'Env -> 'U) (array : 'T[]) (env : 'Env) : 'U[] =
              // Preconditions
              checkNonNull "array" array
  
              let mapping = FSharpFunc<_,_,_,_>.Adapt mapping
              let len = Array.length array
              /// Holds the mapped results.
              let results = Array.zeroCreate len
  
              for i = 0 to len - 1 do
                  results.[i] <- mapping.Invoke (i, array.[i], env)
              results
  
  
  //
  [<RequireQualifiedAccess; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
  module ReaderState =
      /// The standard F# Array module, lifted into the ReaderState monad.
      [<RequireQualifiedAccess; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
      module Array =
          /// A specialization of Array.iter which threads an accumulator through the computation;
          /// this allows the use of actions requiring a (possibly mutable) state variable.
          [<CompiledName("Iterate")>]
          let iter (action : 'T -> 'Env -> 'State -> unit * 'State)
                  (array : 'T[]) (env : 'Env) (state : 'State) : unit * 'State =
              // Preconditions
              checkNonNull "array" array
  
              let action = FSharpFunc<_,_,_,_>.Adapt action
              let len = array.Length
              let mutable state = state
  
              for i = 0 to len - 1 do
                  state <- snd <| action.Invoke (array.[i], env, state)
  
              (), state
  
          /// A specialization of Array.iteri which threads an accumulator through the computation;
          /// this allows the use of actions requiring a (possibly mutable) state variable.
          [<CompiledName("IterateIndexed")>]
          let iteri (action : int -> 'T -> 'Env -> 'State -> unit * 'State)
                  (array : 'T[]) (env : 'Env) (state : 'State) : unit * 'State =
              // Preconditions
              checkNonNull "array" array
  
              let action = FSharpFunc<_,_,_,_,_>.Adapt action
              let len = array.Length
              let mutable state = state
  
              for i = 0 to len - 1 do
                  state <- snd <| action.Invoke (i, array.[i], env, state)
  
              (), state
  
          /// A specialization of Array.map which threads an accumulator through the computation;
          /// this allows the use of mapping functions requiring a (possibly mutable) state variable.
          [<CompiledName("Map")>]
          let map (mapping : 'T -> 'Env -> 'State -> 'U * 'State)
                  (array : 'T[]) (env : 'Env) (state : 'State) : 'U[] * 'State =
              // Preconditions
              checkNonNull "array" array
  
              let mapping = FSharpFunc<_,_,_,_>.Adapt mapping
              let len = array.Length
              let results = Array.zeroCreate len
              let mutable state = state
  
              for i = 0 to len - 1 do
                  let result, state' = mapping.Invoke (array.[i], env, state)
                  results.[i] <- result
                  state <- state'
  
              results, state
  
          /// A specialization of Array.mapi which threads an accumulator through the computation;
          /// this allows the use of mapping functions requiring a (possibly mutable) state variable.
          [<CompiledName("MapIndexed")>]
          let mapi (mapping : int -> 'T -> 'Env -> 'State -> 'U * 'State)
                  (array : 'T[]) (env : 'Env) (state : 'State) : 'U[] * 'State =
              // Preconditions
              checkNonNull "array" array
  
              let mapping = FSharpFunc<_,_,_,_,_>.Adapt mapping
              let len = array.Length
              let results = Array.zeroCreate len
              let mutable state = state
  
              for i = 0 to len - 1 do
                  let result, state' = mapping.Invoke (i, array.[i], env, state)
                  results.[i] <- result
                  state <- state'
  
              results, state
  
          /// A specialization of Array.map which threads an accumulator through the computation;
          /// this allows the use of mapping functions requiring a (possibly mutable) state variable.
          /// This function traverses the input array from right-to-left.
          [<CompiledName("MapBack")>]
          let mapBack (mapping : 'T -> 'Env -> 'State -> 'U * 'State)
                  (array : 'T[]) (env : 'Env) (state : 'State) : 'U[] * 'State =
              // Preconditions
              checkNonNull "array" array
  
              let mapping = FSharpFunc<_,_,_,_>.Adapt mapping
              let len = array.Length
              let results = Array.zeroCreate len
              let mutable state = state
  
              for i = len - 1 downto 0 do
                  let result, state' = mapping.Invoke (array.[i], env, state)
                  results.[i] <- result
                  state <- state'
  
              results, state
  
          /// A specialization of Array.mapi which threads an accumulator through the computation;
          /// this allows the use of mapping functions requiring a (possibly mutable) state variable.
          /// This function traverses the input array from right-to-left.
          [<CompiledName("MapIndexedBack")>]
          let mapiBack (mapping : int -> 'T -> 'Env -> 'State -> 'U * 'State)
                  (array : 'T[]) (env : 'Env) (state : 'State) : 'U[] * 'State =
              // Preconditions
              checkNonNull "array" array
  
              let mapping = FSharpFunc<_,_,_,_,_>.Adapt mapping
              let len = array.Length
              let results = Array.zeroCreate len
              let mutable state = state
  
              for i = len - 1 downto 0 do
                  let result, state' = mapping.Invoke (i, array.[i], env, state)
                  results.[i] <- result
                  state <- state'
  
              results, state
  
          /// A specialization of Array.map2 which threads an accumulator through the computation;
          /// this allows the use of mapping functions requiring a (possibly mutable) state variable.
          /// This function traverses the input arrays from left-to-right.
          [<CompiledName("Map2")>]
          let map2 (mapping : 'T1 -> 'T2 -> 'Env -> 'State -> 'U * 'State)
                  (array1 : 'T1[]) (array2 : 'T2[]) (env : 'Env) (state : 'State) : 'U[] * 'State =
              // Preconditions
              checkNonNull "array1" array1
              checkNonNull "array2" array2
  
              let len = array1.Length
  
              if array2.Length <> len then
                  invalidArg "array2" "The arrays have differing lengths."
  
              let mapping = FSharpFunc<_,_,_,_,_>.Adapt mapping
              let results = Array.zeroCreate len
              let mutable state = state
  
              for i = 0 to len - 1 do
                  let result, state' = mapping.Invoke (array1.[i], array2.[i], env, state)
                  results.[i] <- result
                  state <- state'
  
              results, state
  
          /// A specialization of Array.mapi2 which threads an accumulator through the computation;
          /// this allows the use of mapping functions requiring a (possibly mutable) state variable.
          /// This function traverses the input arrays from left-to-right.
          [<CompiledName("MapIndexed2")>]
          let mapi2 (mapping : int -> 'T1 -> 'T2 -> 'Env -> 'State -> 'U * 'State)
                  (array1 : 'T1[]) (array2 : 'T2[]) (env : 'Env) (state : 'State) : 'U[] * 'State =
              // Preconditions
              checkNonNull "array1" array1
              checkNonNull "array2" array2
  
              let len = array1.Length
  
              if array2.Length <> len then
                  invalidArg "array2" "The arrays have differing lengths."
  
              let mapping = FSharpFunc<_,_,_,_,_,_>.Adapt mapping
              let results = Array.zeroCreate len
              let mutable state = state
  
              for i = 0 to len - 1 do
                  let result, state' = mapping.Invoke (i, array1.[i], array2.[i], env, state)
                  results.[i] <- result
                  state <- state'
  
              results, state
  
          /// Applies a function to each element of the collection, threading an accumulator argument through the computation.
          [<CompiledName("Fold")>]
          let fold (folder : 'InnerState -> 'T -> 'Env -> 'OuterState -> 'InnerState * 'OuterState)
                  (innerState : 'InnerState) (array : 'T[]) (env : 'Env) (outerState : 'OuterState)
                  : 'InnerState * 'OuterState =
              // Preconditions
              checkNonNull "array" array
  
              let folder = FSharpFunc<_,_,_,_,_>.Adapt folder
              let len = array.Length
              let mutable outerState = outerState
              let mutable innerState = innerState
  
              for i = 0 to len - 1 do
                  let innerState', outerState' = folder.Invoke (innerState, array.[i], env, outerState)
                  innerState <- innerState'
                  outerState <- outerState'
  
              innerState, outerState
  
          /// Applies a function to each element of the collection, threading an accumulator argument through the computation.
          /// The integer index passed to the function indicates the array index of the element being transformed.
          [<CompiledName("FoldIndexed")>]
          let foldi (folder : int -> 'InnerState -> 'T -> 'Env -> 'OuterState -> 'InnerState * 'OuterState)
                  (innerState : 'InnerState) (array : 'T[]) (env : 'Env) (outerState : 'OuterState)
                  : 'InnerState * 'OuterState =
              // Preconditions
              checkNonNull "array" array
  
              let folder = FSharpFunc<_,_,_,_,_,_>.Adapt folder
              let len = array.Length
              let mutable outerState = outerState
              let mutable innerState = innerState
  
              for i = 0 to len - 1 do
                  let innerState', outerState' = folder.Invoke (i, innerState, array.[i], env, outerState)
                  innerState <- innerState'
                  outerState <- outerState'
  
              innerState, outerState
  
  
      /// The ExtCore.Collections.TaggedArray module, lifted into the ReaderState monad.
      [<RequireQualifiedAccess; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
      module TaggedArray =
          open LanguagePrimitives
  
          /// A specialization of Array.mapi which threads an accumulator through the computation;
          /// this allows the use of mapping functions requiring a (possibly mutable) state variable.
          /// The index values are tagged with a unit-of-measure type before applying them to the mapping function.
          [<CompiledName("MapIndexedByTag")>]
          let mapti (mapping : int<'Tag> -> 'T -> 'Env -> 'State -> 'U * 'State)
                  (array : 'T[]) (env : 'Env) (state : 'State) : 'U[] * 'State =
              // Preconditions
              checkNonNull "array" array
  
              let mapping = FSharpFunc<_,_,_,_,_>.Adapt mapping
              let len = array.Length
              let results = Array.zeroCreate len
              let mutable state = state
  
              for i = 0 to len - 1 do
                  let result, state' = mapping.Invoke (Int32WithMeasure<'Tag> i, array.[i], env, state)
                  results.[i] <- result
                  state <- state'
  
              results, state
  
          /// A specialization of Array.mapi which threads an accumulator through the computation;
          /// this allows the use of mapping functions requiring a (possibly mutable) state variable.
          /// This function traverses the input array from right-to-left.
          /// The index values are tagged with a unit-of-measure type before applying them to the mapping function.
          [<CompiledName("MapIndexedByTagBack")>]
          let maptiBack (mapping : int<'Tag> -> 'T -> 'Env -> 'State -> 'U * 'State)
                  (array : 'T[]) (env : 'Env) (state : 'State) : 'U[] * 'State =
              // Preconditions
              checkNonNull "array" array
  
              let mapping = FSharpFunc<_,_,_,_,_>.Adapt mapping
              let len = array.Length
              let results = Array.zeroCreate len
              let mutable state = state
  
              for i = len - 1 downto 0 do
                  let result, state' = mapping.Invoke (Int32WithMeasure<'Tag> i, array.[i], env, state)
                  results.[i] <- result
                  state <- state'
  
              results, state
  
          /// Applies a function to each element of the collection, threading an accumulator argument through the computation.
          /// The integer index passed to the function indicates the array index of the element being transformed.
          /// The index values are tagged with a unit-of-measure type before applying them to the folder function.
          [<CompiledName("FoldIndexedByTag")>]
          let foldti (folder : int<'Tag> -> 'InnerState -> 'T -> 'Env -> 'OuterState -> 'InnerState * 'OuterState)
                  (innerState : 'InnerState) (array : 'T[]) (env : 'Env) (outerState : 'OuterState)
                  : 'InnerState * 'OuterState =
              // Preconditions
              checkNonNull "array" array
  
              let folder = FSharpFunc<_,_,_,_,_,_>.Adapt folder
              let len = array.Length
              let mutable outerState = outerState
              let mutable innerState = innerState
  
              for i = 0 to len - 1 do
                  let innerState', outerState' =
                      folder.Invoke (Int32WithMeasure<'Tag> i, innerState, array.[i], env, outerState)
                  innerState <- innerState'
                  outerState <- outerState'
  
              innerState, outerState
  
  
      /// The ExtCore.Collections.ArraySegment module, lifted into the ReaderState monad.
      [<RequireQualifiedAccess; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
      module ArraySegment =
          /// A specialization of ArraySegment.iter which threads an accumulator through the computation;
          /// this allows the use of actions requiring a (possibly mutable) state variable.
          [<CompiledName("Iterate")>]
          let iter (action : 'T -> 'Env -> 'State -> unit * 'State)
                  (segment : System.ArraySegment<'T>) (env : 'Env) (state : 'State) : unit * 'State =
              let action = FSharpFunc<_,_,_,_>.Adapt action
  
              let array = segment.Array
              let endExclusive = segment.Offset + segment.Count
              let mutable state = state
  
              for i = segment.Offset to endExclusive - 1 do
                  state <- snd <| action.Invoke (array.[i], env, state)
  
              (), state
  
          /// A specialization of ArraySegment.iteri which threads an accumulator through the computation;
          /// this allows the use of actions requiring a (possibly mutable) state variable.
          [<CompiledName("IterateIndexed")>]
          let iteri (action : int -> 'T -> 'Env -> 'State -> unit * 'State)
                  (segment : System.ArraySegment<'T>) (env : 'Env) (state : 'State) : unit * 'State =
              let action = FSharpFunc<_,_,_,_,_>.Adapt action
  
              let array = segment.Array
              let endExclusive = segment.Offset + segment.Count
              let mutable state = state
              let mutable idx = 0
  
              for i = segment.Offset to endExclusive - 1 do
                  state <- snd <| action.Invoke (idx, array.[i], env, state)
                  idx <- idx + 1
  
              (), state
  
          /// A specialization of Array.map which threads an accumulator through the computation;
          /// this allows the use of mapping functions requiring a (possibly mutable) state variable.
          [<CompiledName("Map")>]
          let map (mapping : 'T -> 'Env -> 'State -> 'U * 'State)
                  (segment : System.ArraySegment<'T>) (env : 'Env) (state : 'State) : 'U[] * 'State =
              let mapping = FSharpFunc<_,_,_,_>.Adapt mapping
  
              let array = segment.Array
              let offset = segment.Offset
              let count = segment.Count
              
              let results = Array.zeroCreate count
              let mutable state = state
  
              for i = 0 to count - 1 do
                  let result, state' = mapping.Invoke (array.[offset + i], env, state)
                  results.[i] <- result
                  state <- state'
  
              results, state
  
          /// A specialization of Array.mapi which threads an accumulator through the computation;
          /// this allows the use of mapping functions requiring a (possibly mutable) state variable.
          [<CompiledName("MapIndexed")>]
          let mapi (mapping : int -> 'T -> 'Env -> 'State -> 'U * 'State)
                  (segment : System.ArraySegment<'T>) (env : 'Env) (state : 'State) : 'U[] * 'State =
              let mapping = FSharpFunc<_,_,_,_,_>.Adapt mapping
  
              let array = segment.Array
              let offset = segment.Offset
              let count = segment.Count
              
              let results = Array.zeroCreate count
              let mutable state = state
  
              for i = 0 to count - 1 do
                  let result, state' = mapping.Invoke (i, array.[offset + i], env, state)
                  results.[i] <- result
                  state <- state'
  
              results, state
  
  
  //
  [<RequireQualifiedAccess; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
  module Maybe =
      /// The standard F# Array module, lifted into the Maybe monad.
      [<RequireQualifiedAccess; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
      module Array =
          //
          [<CompiledName("Map")>]
          let dummy () = ()
  
  
  
  //
  