anchor.diff:      /// A pickler/unpickler pair for bools
       let pickleBool =
           {
  -        Pickle = fun (b, s) -> {s with Raw = (PickleConvertors.convFromBool b) @ s.Raw}
  -        Unpickle = fun st ->
  -            let pos = st.Position
  -            let result = PickleConvertors.convToBool pos (st.Raw)
  -            result, {st with Position = pos + sizeof<bool>}
  +        Pickle = fun (b, s) -> pickleHelper (PickleConvertors.convFromBool) b s
  +        Unpickle = fun st -> unpickleHelper (PickleConvertors.convToBool) st
           }
   
       /// A pickler/unpickler pair for bytes
       let pickleByte =
           {
  -        Pickle = fun (b, s) -> {s with Raw = b :: s.Raw}
  -        Unpickle = fun st ->
  -            let pos = st.Position
  -            let result = Array.item (pos) st.Raw
  -            result, {st with Position = pos + sizeof<byte>}
  +        Pickle = fun (b, s) -> pickleHelper (Array.singleton) b s
  +        Unpickle = fun st -> unpickleHelper (Array.item) st
           }
   
       /// A pickler/unpickler pair for int16s of the supplied endianness
       let private pickleInt16E endianness =
           {
  -        Pickle = fun (i16, s) -> {s with Raw = (PickleConvertors.convFromInt16 endianness i16) @ s.Raw}
  -        Unpickle = fun st ->
  -            let pos = st.Position
  -            let result = PickleConvertors.convToInt16 pos endianness (st.Raw)
  -            result, {st with Position = pos + sizeof<int16>}
  +        Pickle = fun (i16, s) -> pickleHelper (PickleConvertors.convFromInt16 endianness) i16 s
  +        Unpickle = fun st -> unpickleHelper (PickleConvertors.convToInt16 endianness) st
           }
   
       /// A pickler/unpickler pair for int32s of the supplied endianness
       let private pickleInt32E endianness =
           {
  -        Pickle = fun (i32, s) -> {s with Raw = (PickleConvertors.convFromInt32 endianness i32) @ s.Raw}
  -        Unpickle = fun st ->
  -            let pos = st.Position
  -            let result = PickleConvertors.convToInt32 pos endianness (st.Raw)
  -            result, {st with Position = pos + sizeof<int32>}
  +        Pickle = fun (i32, s) -> pickleHelper (PickleConvertors.convFromInt32 endianness) i32 s
  +        Unpickle = fun st -> unpickleHelper (PickleConvertors.convToInt32 endianness) st
           }
   
       /// A pickler/unpickler pair for int64s of the supplied endianness
       let private pickleInt64E endianness =
           {
  -        Pickle = fun (i64, s) -> {s with Raw = (PickleConvertors.convFromInt64 endianness i64) @ s.Raw}
  -        Unpickle = fun st ->
  -            let pos = st.Position
  -            let result = PickleConvertors.convToInt64 pos endianness (st.Raw)
  -            result, {st with Position = pos + sizeof<int64>}
  +        Pickle = fun (i64, s) -> pickleHelper (PickleConvertors.convFromInt64 endianness) i64 s
  +        Unpickle = fun st -> unpickleHelper (PickleConvertors.convToInt64 endianness) st
           }
   
       /// A pickler/unpickler pair for float32s of the supplied endianness
       let private pickleFloat32E endianness =
           {
  -        Pickle = fun (f32, s) -> {s with Raw = (PickleConvertors.convFromFloat32 endianness f32) @ s.Raw}
  -        Unpickle = fun st ->
  -            let pos = st.Position
  -            let result = PickleConvertors.convToFloat32 pos endianness (st.Raw)
  -            result, {st with Position = pos + sizeof<float32>}
  +        Pickle = fun (f32, s) -> pickleHelper (PickleConvertors.convFromFloat32 endianness) f32 s
  +        Unpickle = fun st -> unpickleHelper (PickleConvertors.convToFloat32 endianness) st
           }
   
       /// A pickler/unpickler pair for floats of the supplied endianness
       let private pickleFloatE endianness =
           {
  -        Pickle = fun (f64, s) -> {s with Raw = (PickleConvertors.convFromFloat64 endianness f64) @ s.Raw}
  -        Unpickle = fun st ->
  -            let pos = st.Position
  -            let result = PickleConvertors.convToFloat64 pos endianness (st.Raw)
  -            result, {st with Position = pos + sizeof<float>}
  +        Pickle = fun (f64, s) -> pickleHelper (PickleConvertors.convFromFloat64 endianness) f64 s
  +        Unpickle = fun st -> unpickleHelper (PickleConvertors.convToFloat64 endianness) st
           }
   
       /// A pickler/unpickler pair for decimals of the supplied endianness
  
positive.code: 
      /// Converts a bool to a byte list in reverse order
      let convFromBool (b : bool) = 
          arrayFlipToList <| System.BitConverter.GetBytes b 
  
      /// Converts an int16 to a byte list in reverse order
      let convFromInt16 endianness (i16 : int16) = 
          arrayFlipToList << flipForEndianness endianness <| System.BitConverter.GetBytes i16
  
      /// Converts an int32 to a byte list in reverse order
      let convFromInt32 endianness (i32 : int32) = 
          arrayFlipToList << flipForEndianness endianness <| System.BitConverter.GetBytes i32
  
      /// Converts an int64 to a byte list in reverse order
      let convFromInt64 endianness (i64 : int64) = 
          arrayFlipToList << flipForEndianness endianness <| System.BitConverter.GetBytes i64
  
      /// Converts an float32 to a byte list in reverse order
      let convFromFloat32 endianness (f32 : float32) = 
          arrayFlipToList << flipForEndianness endianness <| System.BitConverter.GetBytes f32
  
      /// Converts an float64 to a byte list in reverse order  
      let convFromFloat64 endianness (f64 : float) = 
          arrayFlipToList << flipForEndianness endianness <| System.BitConverter.GetBytes f64
  
      /// Encoding conversion functions
      module Encodings =
  
negative.code:         match x with
          |{Unpickle = _; Pickle = g} -> g (a, st)
  
      /// Helper function that chooses between complete or incremental pickling
      let private pickleHelper f b st =
          match st with
          |PickleComplete ps -> PickleComplete {ps with Raw = (PickleConvertors.arrayFlipToList << f <| b) @ ps.Raw}
          |PickleIncremental ips -> 
              ips.Writer.Write (f b)
              st
      /// Helper function that chooses between complete or incremental unpickling and accepts an arbitrary data-size
      let private unpickleHelperSized size f st =
          match st with
          |UnpickleComplete ps -> 
              let pos = ps.Position
              let result = f pos (ps.Raw)
              result, UnpickleComplete {ps with Position = pos + size}
          |UnpickleIncremental ips ->
              let result = f 0 (ips.Reader.ReadBytes size)
              result, st
  
      /// Helper function that chooses between complete or incremental unpickling and gets the size from the size of the data type
      let private unpickleHelper (f : int -> byte array -> 'a) st =
          unpickleHelperSized (sizeof<'a>) f st
              
  
      /// Given a value of x, returns a pickler of x
  