anchor.diff:          res.[i - start] <- state
       res
   
  -//
  -[<CompiledName("Scan")>]
  -let scan f acc (arr : ResizeArray<'T>) = 
  -    let arrn = length arr
  -    scanSub f acc arr 0 (arrn - 1)
  -
  -//
  -[<CompiledName("ScanBack")>]
  -let scanBack f (arr : ResizeArray<'T>) acc = 
  -    let arrn = length arr
  -    scanBackSub f arr 0 (arrn - 1) acc
  -        
  -//
  -[<CompiledName("TryFindIndexIndexed")>]
  -let tryFindIndexi f (arr: ResizeArray<'T>) = 
  -    let rec go n = if n >= length arr then None elif f n arr.[n] then Some n else go (n+1)
  -    go 0
  -    
  -//
  -[<CompiledName("Zip")>]
  -let zip (arr1: ResizeArray<_>) (arr2: ResizeArray<_>) = 
  -    let len1 = length arr1 
  -    if len1 <> length arr2 then invalidArg "arr2" "the arrays have different lengths"
  -    init len1 (fun i -> arr1.[i], arr2.[i])
  -
  -//
  -[<CompiledName("Unzip")>]
  -let unzip (arr: ResizeArray<_>) = 
  -    let len = length arr
  -    let res1 = new ResizeArray<_>(len)
  -    let res2 = new ResizeArray<_>(len)
  -    for i = 0 to len - 1 do 
  -        let x,y = arr.[i] 
  -        res1.Add(x)
  -        res2.Add(y)
  -    res1,res2
  -
  -//
  -[<CompiledName("Blit")>]
  -let blit (arr1: ResizeArray<'T>) start1 (arr2: ResizeArray<'T>) start2 len =
  -    if start1 < 0 then invalidArg "start1" "index must be positive"
  -    if start2 < 0 then invalidArg "start2" "index must be positive"
  -    if len < 0 then invalidArg "len" "length must be positive"
  -    if start1 + len > length arr1 then invalidArg "start1" "(start1+len) out of range"
  -    if start2 + len > length arr2 then invalidArg "start2" "(start2+len) out of range"
  -    for i = 0 to len - 1 do 
  -        arr2.[start2+i] <- arr1.[start1 + i]
  -
  -//
  -[<CompiledName("Partition")>]
  -let partition f (arr: ResizeArray<_>) = 
  -    let res1 = new ResizeArray<_>()
  -    let res2 = new ResizeArray<_>()
  -    for i = 0 to length arr - 1 do 
  -        let x = arr.[i] 
  -        if f x then res1.Add(x) else res2.Add(x)
  -    res1, res2
  -
  -
  -let inline private indexNotFound () =
  -    keyNotFound "An index satisfying the predicate was not found in the collection"
  -
  -//
  -[<CompiledName("FindIndexIndexed")>]
  -let findIndexi f (arr: ResizeArray<_>) =
  -    let rec go n = if n >= length arr then indexNotFound() elif f n arr.[n] then n else go (n+1)
  -    go 0
  -
  
positive.code:     resizeArray.Add value
      resizeArray
  
  
  
  (* Functions below this point still need to be cleaned up. *)
  
  //
  [<CompiledName("Iter2")>]
  let iter2 f (arr1: ResizeArray<'T>) (arr2: ResizeArray<'b>) = 
      let f = FSharpFunc<_,_,_>.Adapt(f)
      let len1 = length arr1
      if len1 <> length arr2 then invalidArg "arr2" "the arrays have different lengths"
      for i = 0 to len1 - 1 do 
          f.Invoke(arr1.[i], arr2.[i])
  
  //
  [<CompiledName("Map2")>]
  let map2 f (arr1: ResizeArray<'T>) (arr2: ResizeArray<'b>) = 
      let f = FSharpFunc<_,_,_>.Adapt(f)
      let len1 = length arr1
      if len1 <> length arr2 then invalidArg "arr2" "the arrays have different lengths"
      let res = new ResizeArray<_>(len1)
      for i = 0 to len1 - 1 do
          res.Add(f.Invoke(arr1.[i], arr2.[i]))
      res
  
  //
  [<CompiledName("Rev")>]
  let rev (arr: ResizeArray<_>) = 
      let len = length arr 
      let res = new ResizeArray<_>(len)
      for i = len - 1 downto 0 do 
          res.Add(arr.[i])
      res
  
  //
  [<CompiledName("Exists2")>]
  let exists2 f (arr1: ResizeArray<_>) (arr2: ResizeArray<_>) =
      let len1 = length arr1
      if len1 <> length arr2 then invalidArg "arr2" "the arrays have different lengths"
      let rec loop i = i < len1 && (f arr1.[i] arr2.[i] || loop (i+1))
      loop 0
  
  //
  [<CompiledName("FoldSub")>]
  
negative.code:     res
  
  //
  [<CompiledName("Scan")>]
  let scan f acc (arr : ResizeArray<'T>) = 
      let arrn = length arr
      scanSub f acc arr 0 (arrn - 1)
  
  //
  [<CompiledName("ScanBack")>]
  let scanBack f (arr : ResizeArray<'T>) acc = 
      let arrn = length arr
      scanBackSub f arr 0 (arrn - 1) acc
  
  //
  [<CompiledName("ScanSub")>]
  