anchor.diff:     foldBackIndexed2 (fun _ x y acc -> f x y acc) array1 array2 state 
   
   let reduce reduction array =
  -   if length array = 0 then invalidOp "Array was empty"
  +   if lengthImpl array = 0 then invalidOp LanguagePrimitives.ErrorStrings.InputArrayEmptyString
      else foldIndexed (fun i acc x -> if i = 0 then x else reduction acc x) Unchecked.defaultof<_> array
   
   let reduceBack reduction array =
  -   if length array = 0 then invalidOp "Array was empty"
  +   if lengthImpl array = 0 then invalidOp LanguagePrimitives.ErrorStrings.InputArrayEmptyString
      else foldBackIndexed (fun i x acc -> if i = 0 then x else reduction acc x) array Unchecked.defaultof<_>
   
   let forAll2 predicate array1 array2 =
      fold2 (fun acc x y -> acc && predicate x y) true array1 array2
   
   let rec existsOffset predicate array index =
  -   if index = length array then false
  +   if index = lengthImpl array then false
      else predicate array.[index] || existsOffset predicate array (index+1)
   
   let exists predicate array = 
      existsOffset predicate array 0
   
   let rec existsOffset2 predicate array1 (array2:_ []) index =
  -   if index = length array1 then false
  +   if index = lengthImpl array1 then false
      else predicate array1.[index] array2.[index] || existsOffset2 predicate array1 array2 (index+1)
   
   let rec exists2 predicate array1 array2 =
  -   if length array1 <> length array2 then failwith "Arrays had different lengths"
  +   if lengthImpl array1 <> lengthImpl array2 then failwith "Arrays had different lengths"
      existsOffset2 predicate array1 array2 0
   
  -let inline sum (array: 'T []) : 'T =
  -   fold (+) LanguagePrimitives.GenericZero array
  -
  -let inline sumBy (projection: 'T -> 'U) (array: 'T []) : 'U =
  -   fold (fun acc x -> acc + projection x) LanguagePrimitives.GenericZero array
  -
  -let inline maxBy projection array =
  -   reduce (fun x y -> if projection y > projection x then y else x) array
  -
  -let inline max array =
  -   reduce max array
  -
  -let inline minBy projection array =
  -   reduce (fun x y -> if projection y > projection x then x else y) array
  -
  -let inline min array =
  -   reduce min array
  -
  -let inline average (array: 'T []) : 'T =
  -   let total = sum array
  -   let count = sumBy (fun _ -> LanguagePrimitives.GenericOne< 'T >) array
  -   total / count
  -
  -let inline averageBy (projection: 'T -> 'U ) (array: 'T []) : 'U =
  -   let total = sumBy projection array
  -   let count = sumBy (fun _ -> LanguagePrimitives.GenericOne< 'T >) array
  -   total / count
  -
  +let sum (array: 'T[]) : 'T =
  +    let mutable acc = nativeZero<'T>()
  +    for i = 0 to array.Length - 1 do
  +        acc <- nativeAddition acc array.[i]
  +    acc
  +
  +let sumBy (projection: 'T -> 'U) (array: 'T []) : 'U =
  +    let mutable acc = nativeZero<'U>()
  +    for i = 0 to array.Length - 1 do
  +        acc <- array.[i] |> projection |> nativeAddition acc 
  +    acc
  +
  +let maxBy projection array =
  +    reduce (fun x y -> if projection y > projection x then y else x) array
  +
  +let max array =
  +    reduce max array
  +
  +let minBy projection array =
  +    reduce (fun x y -> if projection y > projection x then x else y) array
  +
  +let min array =
  +    reduce min array
  +
  +let average (array: 'T []) : 'T =
  +    if array.Length = 0 then invalidArg "array" LanguagePrimitives.ErrorStrings.InputArrayEmptyString
  +    let total = sum array
  +    nativeDivision total array.Length
  +
  +let averageBy (projection: 'T -> 'U) (array: 'T []) : 'U =
  +    if array.Length = 0 then invalidArg "array" LanguagePrimitives.ErrorStrings.InputArrayEmptyString
  +    let total = sumBy projection array
  +    nativeDivision total array.Length
  +
  
positive.code: 
  let private concatImpl (cons: ArrayCons) (arrays: 'T[][]): 'T[] =
      if arrays.Length > 0 then
          if isTypedArray arrays.[0] then
              typedArrayConcatImpl cons arrays
          else
              dynamicArrayConcatImpl arrays
  
negative.code:         empty
      else
          let count = max count 0
          sliceFromImpl array count
  
  let skipWhile predicate (array: 'T[]) =
      let mutable count = 0
  