anchor.diff:                                  mapping.Invoke (idx, array.[idx], state, cont)
   
                       // Create and return a continuation will map the array elements when called.
  -                    // The function passed to 'buildFirstArgCont' here is used to store the mapped
  +                    // The function passed to 'buildCont' here is used to store the mapped
                       // last element of the array, then call the original continuation with the results.
  -                    buildFirstArgCont (len - 1) <| fun (prevElementResult : 'U, state : 'State) ->
  +                    buildCont (len - 1) <| fun (prevElementResult : 'U, state : 'State) ->
                           // Save the last argument's accumulator value.
                           results.[len - 1] <- prevElementResult
   
  
positive.code:                 state <- state'
  
              results, state
  
  
  //
  
negative.code: 
  
  //
  [<RequireQualifiedAccess; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
  module StatefulChoice =
      /// The standard F# Array module, lifted into the StatefulChoice monad.
      [<RequireQualifiedAccess; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
      module Array =
          /// A specialization of Array.map which threads an accumulator through the computation and which also
          /// short-circuits the computation if the mapping function returns an error when any element is applied to it.
          [<CompiledName("Map")>]
          let map (mapping : 'T -> 'State -> Choice<'U, 'Error> * 'State)
                  (array : 'T[]) (state : 'State) : Choice<'U[], 'Error> * 'State =
              // Preconditions
              checkNonNull "array" array
  
              let mapping = FSharpFunc<_,_,_>.Adapt mapping
              let len = Array.length array
              /// Holds the mapped results.
              let results = Array.zeroCreate len
  
              let mutable state = state
              let mutable error = None
              let mutable index = 0
  
              while index < len && Option.isNone error do
                  let result, state' = mapping.Invoke (array.[index], state)
                  
                  // Update the state, even if the result was an error.
                  state <- state'
                  
                  // Check the result; short-circuit if it's an error.
                  match result with
                  | Choice2Of2 err ->
                      error <- Some err
                  | Choice1Of2 result ->
                      results.[index] <- result
                      index <- index + 1
              
              // Return the updated state along with the
              // result (or error, if set).
              match error with
              | Some error ->
                  (Choice2Of2 error), state
              | None ->
                  (Choice1Of2 results), state
  
  
  //
  [<RequireQualifiedAccess>]
  module Cps =
      //
  