anchor.diff:      else Some array.[array.Length-1]
   
   let mapIndexed (f: int -> 'T -> 'U) (source: 'T[]) ([<Inject>] cons: Cons<'U>): 'U[] =
  -    // let len = source.Length
  -    // let target = allocateArrayFromCons cons len
  -    // for i = 0 to (len - 1) do
  -    //     target.[i] <- f i source.[i]
  -    // target
  -    mapiFromCons cons (fun x i -> f i x) source
  +    let len = source.Length
  +    let target = allocateArrayFromCons cons len
  +    for i = 0 to (len - 1) do
  +        target.[i] <- f i source.[i]
  +    target
   
   let map (f: 'T -> 'U) (source: 'T[]) ([<Inject>] cons: Cons<'U>): 'U[] =
  -    // let len = source.Length
  -    // let target = allocateArrayFromCons cons len
  -    // for i = 0 to (len - 1) do
  -    //     target.[i] <- f source.[i]
  -    // target
  -    mapFromCons cons (fun x -> f x) source
  +    let len = source.Length
  +    let target = allocateArrayFromCons cons len
  +    for i = 0 to (len - 1) do
  +        target.[i] <- f source.[i]
  +    target
   
   let mapIndexed2 (f: int->'T1->'T2->'U) (source1: 'T1[]) (source2: 'T2[]) ([<Inject>] cons: Cons<'U>): 'U[] =
       if source1.Length <> source2.Length then failwith "Arrays had different lengths"
  
positive.code:         | None -> ()
          | Some y -> pushImpl res y |> ignore
      if jsTypeof cons = "function"
      then arrayFromCons cons res
      else res // avoid extra copy
  
  let foldIndexed folder (state: 'State) (array: 'T[]) =
  
negative.code: module Helpers =
      [<Emit("Array.from($0)")>]
      let arrayFrom (xs: 'T seq): 'T[] = jsNative
  
      [<Emit("new Array($0)")>]
      let allocateArray (len: int): 'T[] = jsNative
  