_(USS      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQR type-families experimental Safe-Inferred non-portable experimentalEdward Kmett <ekmett@gmail.com> Trustworthy0Efficiently write a byte into the output buffer )An efficient primitive to write a strict S into the output buffer. In binaryL this flushes the current buffer, and writes the argument into a new chunk.  Write a lazy T efficiently. With binary6, this simply appends the chunks to the output buffer Pop the S0 we have constructed so far, if any, yielding a  new chunk in the result S. If we're building a strict S with cereal then this does nothing. Write a U in little endian format Write a U in big endian format O(1). Write a U+ in native host order and host endianness.  For portability issues see . Write a V in little endian format Write a V in big endian format O(1). Write a V+ in native host order and host endianness.  For portability issues see  putWordhost. Write a W in little endian format Write a W in big endian format O(1). Write a W+ in native host order and host endianness.  For portability issues see  putWordhost. O(1).1 Write a single native machine word. The word is = written in host order, host endian form, for the machine you're on. G On a 64 bit machine the Word is an 8 byte value, on a 32 bit machine, 6 4 bytes. Values written this way are not portable to > different endian or word sized machines, without conversion. Put a value into a lazy T using X. Put a value into a strict S using Y.  Z[\]^_`ab    Z[\]^_`ab type-families experimentalEdward Kmett <ekmett@gmail.com> TrustworthyAn c4 number type used for unchecked skips and counting. 5The underlying ByteString type used by this instance  Skip ahead n bytes. Fails if fewer than n bytes are available.  If at least nE bytes are available return at least that much of the current input.  Otherwise fail. Run ga*, but return without consuming its input.  Fails if ga fails. Like , but consume the input if gma returns 'Just _'.  Fails if gma fails. Like , but consume the input if gea returns 'Right _'.  Fails if gea fails. Pull n/ bytes from the input, as a strict ByteString. ,Get the number of remaining unparsed bytes. : Useful for checking whether all input has been consumed. . Note that this forces the rest of the input. *Test whether all input has been consumed, - i.e. there are no remaining unparsed bytes. "Read a Word8 from the monad state ! An efficient d/ method for strict ByteStrings. Fails if fewer  than n bytes are left in the input. " An efficient d: method for lazy ByteStrings. Does not fail if fewer than  n bytes are left in the input. #Read a U in big endian format $Read a U in little endian format %O(1). Read a 2 byte U+ in native host order and host endianness. &Read a V in big endian format 'Read a V in little endian format (O(1). Read a V+ in native host order and host endianness. )Read a W in big endian format *Read a W in little endian format +O(1). Read a W* in native host order and host endianess. ,O(1).8 Read a single native machine word. The word is read in 2 host order, host endian form, for the machine you're on. On a 64 bit D machine the Word is an 8 byte value, on a 32 bit machine, 4 bytes. -Get something from a lazy T using e. .Get something from a strict S using f. # !"#$%&'()*+,-.ghijklmno !"#$%&'()*+,-. !"#$%&'()*+,-.  !"#$%&'()*+,-.ghijklmno non-portable experimentalEdward Kmett <ekmett@gmail.com> Trustworthy21Used internally to provide generic serialization 8<Used internally to provide generic big-endian serialization =1Used internally to provide generic serialization @*Methods to serialize and deserialize type a to a binary representation JInstances provided here for fixed-with Integers and Words are big endian. NInstances for strict and lazy bytestrings store also the length of bytestring Cbig endian. Instances for Word and Int are host endian as they are machine-specific types. C*Methods to serialize and deserialize type a to a big and little endian .binary representations. Methods suffixed with host are automatically defined =to use equal the methods corresponding to the current machine' s native (endianness, but they can be overridden. Jserialize any p in a host-specific format. Kdeserialize any p in a host-specific format. n/0123456789:;<=>?@ABCDEFGHIqrstJKLMNOuvwxyz{|}~!/0123456789:;<=>?@ABCDEFGHIJKLMNO!@ABCDEFGHI567LM/01NOJK=>?89:;<234Z/0123456789:;<=>?@ABCDEFGHIqrstJKLMNOuvwxyz{|}~+type-families, generalized newtype deriving experimentalNonePInteger/7Word types serialized to base-128 variable-width ints. import Data.Monoid (mconcat)&import Data.ByteString.Lazy (toChunks)7mconcat $ toChunks $ runPutL $ serialize (97 :: Word64)"\NUL\NUL\NUL\NUL\NUL\NUL\NULa">mconcat $ toChunks $ runPutL $ serialize (97 :: VarInt Word64)"a"PQRPQRPQRPQR      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVVWXYZX[Z\]^\]_\]`abcdecfghijklmn\opqrsatudvuwxyz{|}~\ bytes-0.12Data.Bytes.SignedData.Bytes.PutData.Bytes.GetData.Bytes.SerialData.Bytes.VarIntSignedUnsignedunsignedsignedMonadPutputWord8 putByteStringputLazyByteStringflush putWord16le putWord16be putWord16host putWord32le putWord32be putWord32host putWord64le putWord64be putWord64host putWordhostrunPutLrunPutSMonadGet RemainingBytesskipensure lookAhead lookAheadM lookAheadEgetBytes remainingisEmptygetWord8 getByteStringgetLazyByteString getWord16be getWord16le getWord16host getWord32be getWord32le getWord32host getWord64be getWord64le getWord64host getWordhostrunGetLrunGetSSerial2serializeWith2deserializeWith2GSerial1gserializeWithgdeserializeWithSerial1 serializeWithdeserializeWith GSerialEndian gserializeBEgdeserializeBE gserializeLEgdeserializeLEGSerial gserialize gdeserializeSerial serialize deserialize SerialEndian serializeBE deserializeBE serializeLE deserializeLE serializeHostdeserializeHoststorerestore serialize1 deserialize1 serialize2 deserialize2VarIntunVarIntbytestring-0.10.0.2Data.ByteString.Internal ByteStringData.ByteString.Lazy.InternalbaseGHC.WordWord16Word32Word64binary-0.5.1.1Data.Binary.PutrunPutcereal-0.3.5.2Data.Serialize.Put$fMonadPutRWST$fMonadPutRWST0$fMonadPutWriterT$fMonadPutWriterT0$fMonadPutReaderT$fMonadPutStateT$fMonadPutStateT0$fMonadPutPutM$fMonadPutPutM0GHC.RealIntegral mtl-2.1.2Control.Monad.State.ClassgetData.Binary.GetrunGetData.Serialize.Get$fMonadGetRWST$fMonadGetRWST0$fMonadGetWriterT$fMonadGetWriterT0$fMonadGetReaderT$fMonadGetStateT$fMonadGetStateT0 $fMonadGetGet$fMonadGetGet0Foreign.StorableStorableword64ToDoubledoubleToWord64 word32ToFloat floatToWord32 $fSerial2Map$fSerial2(,,,,)$fSerial2(,,,) $fSerial2(,,) $fSerial2(,)$fSerial2Either $fGSerial1K1 $fGSerial1M1 $fGSerial1:+: $fGSerial1:*: $fGSerial1V1 $fGSerial1U1$fGSerial1Rec1$fGSerial1Par1 $fSerial1Map$fSerial1IntMap $fSerial1Set $fSerial1Seq$fSerial1(,,,,)$fSerial1(,,,) $fSerial1(,,) $fSerial1(,)$fSerial1Either$fSerial1Maybe $fSerial1[]$fGSerialEndianK1 $fGSerialK1 $fGSerialM1 $fGSerial:+: $fGSerial:*: $fGSerialV1 $fGSerialU1 $fSerialMap$fSerialIntMap $fSerialSet $fSerialSeq$fSerialIntSet $fSerialVoid $fSerialInt8 $fSerialInt16 $fSerialInt32 $fSerialInt64 $fSerialInt $fSerialWord8$fSerialWord16$fSerialWord32$fSerialWord64 $fSerialWord $fSerialChar $fSerialFloat$fSerialDouble $fSerialBool$fSerial(,,,,) $fSerial(,,,) $fSerial(,,) $fSerial(,)$fSerialEither $fSerialMaybe $fSerial[] $fSerial() $fSerialText $fSerialText0$fSerialByteString$fSerialByteString0$fSerialEndianInt16$fSerialEndianInt32$fSerialEndianInt64$fSerialEndianWord16$fSerialEndianWord32$fSerialEndianWord64$fSerialEndianChar$fSerialEndianFloat$fSerialEndianDouble putVarInt getVarInt$fSerialVarInt