anchor.diff:                  Buffer.BlockCopy(arrObj, 0, buffer, curPos, sizeInBytes)
                   memStream.Position <- newLen
   
  -    let writePrimitiveArray : Type * int[] * int[] * Array -> unit = 
  -        let writePrimitiveArrayOneByOne(elType: Type, lowerBounds: int[], lengths: int[], arrObj: Array) = 
  -            match Type.GetTypeCode(elType) with
  +    let writePrimitiveArray : SerTypeInfo * int[] * int[] * Array -> unit = 
  +        let writePrimitiveArrayOneByOne(arrayTypeInfo: SerTypeInfo, lowerBounds: int[], lengths: int[], arrObj: Array) = 
  +            match Type.GetTypeCode(arrayTypeInfo.Type.GetElementType()) with
               | TypeCode.Boolean -> let arr = arrObj :?> Boolean[] in arr |> Array.iter stream.Write
               | TypeCode.Byte -> let arr = arrObj :?> Byte[] in arr |> Array.iter stream.Write
               | TypeCode.SByte -> let arr = arrObj :?> SByte[] in arr |> Array.iter stream.Write
  
positive.code:                     let rank = reader.ReadInt32()
                      let lowerBounds : int[] = Array.zeroCreate rank
                      let lengths : int[] = Array.zeroCreate rank
                      do readPrimitiveArray typeof<int> lowerBounds
                      do readPrimitiveArray typeof<int> lengths
                      let elType = arrType.GetElementType()
                      let newArr = Array.CreateInstance(elType, lengths, lowerBounds)
                      marked.Add newArr
                      do this.ReadArray(elType, lowerBounds, lengths, newArr)
                      upcast newArr
                  | typeType when typeof<Type>.IsAssignableFrom(typeType) -> 
                      let typeName = reader.ReadString()
  
negative.code:             | TypeCode.Double -> let arr = arrObj :?> Double[] in arr |> Array.iter stream.Write
              | TypeCode.Single -> let arr = arrObj :?> Single[] in arr |> Array.iter stream.Write
              | TypeCode.Decimal | TypeCode.DateTime | TypeCode.DBNull | TypeCode.String | TypeCode.Object | TypeCode.Empty | _ -> 
                  failwith <| sprintf "Unknown primitive type %A" (arrayTypeInfo.Type.GetElementType())
          match stream.BaseStream with
          | :? MemoryStream as memStream -> 
              fun (arrayTypeInfo: SerTypeInfo, lowerBounds: int[], lengths: int[], arrObj: Array) -> 
                  writeMemoryBlittableArray (arrObj, arrayTypeInfo.GetElementSize(), memStream)
          | _ -> writePrimitiveArrayOneByOne
  
      let writeValueArray : Type * int[] * int[] * Array -> unit = 
  