anchor.diff:  
               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 -> 'State -> 'U * 'State) (array : 'T[]) (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], 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 -> 'State -> 'U * 'State) (array : 'T[]) (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], 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 -> 'State -> 'U * 'State) (array1 : 'T1[]) (array2 : 'T2[]) (state : 'State) : 'U[] * 'State =
  +            // Preconditions
  +            if isNull array1 then nullArg "array1"
  +            elif isNull array2 then nullArg "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], 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 -> 'State -> 'U * 'State) (array1 : 'T1[]) (array2 : 'T2[]) (state : 'State) : 'U[] * 'State =
  +            // Preconditions
  +            if isNull array1 then nullArg "array1"
  +            elif isNull array2 then nullArg "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], 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 -> 'OuterState -> 'InnerState * 'OuterState) (innerState : 'InnerState) (array : 'T[]) (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], 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 -> 'OuterState -> 'InnerState * 'OuterState) (innerState : 'InnerState) (array : 'T[]) (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], outerState)
  +                innerState <- innerState'
  +                outerState <- outerState'
  +
  +            innerState, outerState
  +
  +
  +    /// The ExtCore.Collections.TaggedArray module, lifted into the State monad.
  +    [<RequireQualifiedAccess; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
  +    module TaggedArray =
           /// 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.
  
positive.code: 
              for i = 0 to len - 1 do
                  let result, state' = mapping.Invoke (LanguagePrimitives.Int32WithMeasure<'Tag> i, array.[i], 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 -> 'State -> 'U * 'State) (array : 'T[]) (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], 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 -> 'State -> 'U * 'State) (array : 'T[]) (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], state)
                  results.[i] <- result
                  state <- state'
  
  
negative.code:             mapRec ([], state, list)
  
  
      /// The ExtCore.Collections.ArraySegment module, lifted into the ProtectedState monad.
      [<RequireQualifiedAccess; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
      module ArraySegment =
          /// A specialization of ArraySegment.iter which threads an accumulator through the computation and which also
  