y      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~(c) Edward Kmett 2013-2015BSD3Edward Kmett <ekmett@gmail.com> experimental type-families Trustworthy7<FT(An 3 number type used for unchecked skips and counting.4The underlying ByteString type used by this instance Skip ahead n bytes. Fails if fewer than n bytes are available. If at least nU bytes are available return at least that much of the current input. Otherwise fail.Run ga4, 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. VTest whether all input has been consumed, i.e. there are no remaining unparsed bytes. !Read a Word8 from the monad state  An efficient 5 method for strict ByteStrings. Fails if fewer than n bytes are left in the input.  An efficient ; method for lazy ByteStrings. Does not fail if fewer than n bytes are left in the input.Read a  in big endian formatRead a  in little endian formatO(1). Read a 2 byte * in native host order and host endianness.Read a  in big endian formatRead a  in little endian formatO(1). Read a * in native host order and host endianness.Read a  in big endian formatRead a  in little endian formatO(1). Read a * in native host order and host endianness.O(1). Read a single native machine word. The word is read in host order, host endian form, for the machine you're on. On a 64 bit machine the Word is an 8 byte value, on a 32 bit machine, 4 bytes.Get something from a lazy  using .Get something from a strict  using .   , ) (c) Edward Kmett 2013-2015BSD3Edward Kmett <ekmett@gmail.com> experimental non-portableSafe 7<>?FST@%/Efficiently write a byte into the output buffer&)An efficient primitive to write a strict  into the output buffer.In binaryK this flushes the current buffer, and writes the argument into a new chunk.' Write a lazy  efficiently.With binary5, this simply appends the chunks to the output buffer(Pop the I we have constructed so far, if any, yielding a new chunk in the result .If we're building a strict  with cereal then this does nothing.)Write a  in little endian format*Write a  in big endian format+O(1). Write a G in native host order and host endianness. For portability issues see 2.,Write a  in little endian format-Write a  in big endian format.O(1). Write a G in native host order and host endianness. For portability issues see  putWordhost./Write a  in little endian format0Write a  in big endian format1O(1). Write a G in native host order and host endianness. For portability issues see  putWordhost.2O(1).0 Write a single native machine word. The word is written in host order, host endian form, for the machine you're on. On a 64 bit machine the Word is an 8 byte value, on a 32 bit machine, 4 bytes. Values written this way are not portable to different endian or word sized machines, without conversion.3Put a value into a lazy  using .4Put a value into a strict  using .$(*)-,0/2+.1%&'34$%%&&''(())**++,,--..//00112234$%%&&''(())**++,,--..//001122BSD3 experimental type-familiesSafe<FTC?@AB@A?BBSD3 experimental+type-families, generalized newtype derivingNone<FKTDCDECDECDE(c) Edward Kmett 2013-2015BSD3Edward Kmett <ekmett@gmail.com> experimental non-portable Trustworthy 7<>?FSTVx R0Used internally to provide generic serializationX;Used internally to provide generic big-endian serialization]0Used internally to provide generic serialization`*Methods to serialize and deserialize type a to a binary representationInstances provided here for fixed-with Integers and Words are big endian. Instances for strict and lazy bytestrings store also the length of bytestring big 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  in a host-specific format.kdeserialize any  in a host-specific format.6runGetL deserialize $ runPutL $ serialize LT::OrderingLT6runGetL deserialize $ runPutL $ serialize EQ::OrderingEQ6runGetL deserialize $ runPutL $ serialize GT::OrderingGTfgetModJulianDate $ (runGetL deserialize $ runPutL $ serialize (ModJulianDate $ 5 % 11)::UniversalTime)5 % 11J(runGetL deserialize $ runPutL $ serialize (5 % 11::Ratio Int))::Ratio Int5 % 11Y(runGetL deserialize $ runPutL $ serialize (addAbsoluteTime 18.2 taiEpoch))::AbsoluteTime1858-11-17 00:00:18.2 TAIe(runGetL deserialize $ runPutL $ serialize (read "2014-01-01 10:54:42.478031 UTC"::UTCTime))::UTCTime2014-01-01 10:54:42.478031 UTCF(runGetL deserialize $ runPutL $ serialize (ModifiedJulianDay 1))::Day 1858-11-18F(runGetL deserialize $ runPutL $ serialize (1.82::DiffTime))::DiffTime1.82sF(runGetL deserialize $ runPutL $ serialize (1.82::DiffTime))::DiffTime1.82sF(runGetL deserialize $ runPutL $ serialize (1.82::Fixed E2))::Fixed E21.82ErunGetL deserialize (runPutL (serialize (10^10::Natural))) :: Natural 10000000000N(runGetL deserialize $ runPutL $ serialize (1822304234^100::Integer))::Integer115368812579128172803867366576339947332796540054052185472042218522037227934707037623902492207671987696439966697503243972076991940820348847422930433939639982092916577692754723458548819441583937289395076910527534916776189405228720063994377687015476947534961767053653973945346259230972683338173842343243493433367681264359887291905132383269175086733345253389374961758293922003996035662362278340494093804835649459223465051596978792130073960666112508481814461273829244289795707398202762289955919352549768394583446336873179280924584333491364188425976869717125645749497258775598562132278030402205794994603544837805140410310712693778605743100915046769381631247123664460203591228745772887977959388457679427407639421147498028487544882346912935398848298806021505673449774474457435816552278997100556732447852816961683577731381792363312695347606768120122976105200574809419685234274705929886121600174028733812771637390342332436695318974693376>Integer/Word types serialized to base-128 variable-width ints.import Data.Monoid (mconcat),import qualified Data.ByteString.Lazy as BSL;mconcat $ BSL.toChunks $ runPutL $ serialize (97 :: Word64)"\NUL\NUL\NUL\NUL\NUL\NUL\NULa"Bmconcat $ BSL.toChunks $ runPutL $ serialize (97 :: VarInt Word64)"a"!OPQRSTUVWXYZ[\]^_`abcdefghijklmno-`aabbcddeeffgghiUVVWWlmOPQnojk]^_XYYZZ[[\\RSTOPQRSTUVVWWXYYZZ[[\\]^_`aabbc ddeeffgghi      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~#bytes-0.15.4-LhNvD7pcRn41FJv9dGXCs2Data.Bytes.GetData.Bytes.PutData.Bytes.SignedData.Bytes.VarIntData.Bytes.SerialMonadGet RemainingBytesskipensure lookAhead lookAheadM lookAheadEgetBytes remainingisEmptygetWord8 getByteStringgetLazyByteString getWord16be getWord16le getWord16host getWord32be getWord32le getWord32host getWord64be getWord64le getWord64host getWordhostrunGetLrunGetS$fMonadGetExceptT$fMonadGetRWST$fMonadGetRWST0$fMonadGetWriterT$fMonadGetWriterT0$fMonadGetReaderT$fMonadGetStateT$fMonadGetStateT0 $fMonadGetGet$fMonadGetGet0MonadPutputWord8 putByteStringputLazyByteStringflush putWord16le putWord16be putWord16host putWord32le putWord32be putWord32host putWord64le putWord64be putWord64host putWordhostrunPutLrunPutS$fMonadPutExceptT$fMonadPutRWST$fMonadPutRWST0$fMonadPutWriterT$fMonadPutWriterT0$fMonadPutReaderT$fMonadPutStateT$fMonadPutStateT0$fMonadPutPutM$fMonadPutPutM0SignedUnsignedunsignedsignedVarIntunVarInt $fEqVarInt $fOrdVarInt $fShowVarInt $fEnumVarInt $fNumVarInt$fIntegralVarInt$fBoundedVarInt $fRealVarInt $fBitsVarIntSerial2serializeWith2deserializeWith2GSerial1gserializeWithgdeserializeWithSerial1 serializeWithdeserializeWith GSerialEndian gserializeBEgdeserializeBE gserializeLEgdeserializeLEGSerial gserialize gdeserializeSerial serialize deserialize SerialEndian serializeBE deserializeBE serializeLE deserializeLE serializeHostdeserializeHoststorerestore serialize1 deserialize1 serialize2 deserialize2 $fGSerialM1 $fGSerial:+: $fGSerial:*: $fGSerialV1 $fGSerialU1 $fGSerialK1 $fSerialLast $fSerialFirst$fSerialProduct $fSerialSum $fSerialAny $fSerialAll $fSerialDual$fSerialReverse$fSerialProduct0$fSerialConstant$fSerialIdentity$fSerialZipList$fSerialVersion $fSerialDown$fSerialOrdering$fSerialZonedTime$fSerialLocalTime$fSerialTimeOfDay$fSerialTimeZone$fSerialUniversalTime $fSerialRatio$fSerialAbsoluteTime$fSerialUTCTime $fSerialDay$fSerialNominalDiffTime$fSerialDiffTime $fSerialFixed$fSerialNatural$fSerialInteger$fSerialVarInt$fSerialHashSet $fSerialSet$fSerialIntSet $fSerialVoid$fSerialScientific $fSerialInt8 $fSerialInt $fSerialWord8 $fSerialWord $fSerialBool$fSerial(,,,,) $fSerial(,,,) $fSerial(,,) $fSerial(,)$fSerialEither $fSerialMaybe $fSerial[] $fSerial() $fSerialText $fSerialText0$fSerialByteString$fSerialByteString0$fGSerialEndianK1 $fSerialInt16 $fSerialInt32 $fSerialInt64$fSerialWord16$fSerialWord32$fSerialWord64 $fSerialChar $fSerialFloat$fSerialDouble$fSerialEndianInt16$fSerialEndianInt32$fSerialEndianInt64$fSerialEndianWord16$fSerialEndianWord32$fSerialEndianWord64$fSerialEndianChar$fSerialEndianFloat$fSerialEndianDouble $fGSerial1K1 $fGSerial1M1 $fGSerial1:+: $fGSerial1:*: $fGSerial1V1 $fGSerial1U1$fGSerial1Par1 $fGSerial1:.:$fGSerial1Rec1 $fSerial1Seq$fSerial1Maybe $fSerial1[]$fSerialHashMap $fSerialMap$fSerialIntMap $fSerialSeq$fSerial2(,,,,)$fSerial2(,,,) $fSerial2(,,) $fSerial2(,)$fSerial2Either$fSerial1HashMap $fSerial1Map$fSerial1IntMap$fSerial1(,,,,)$fSerial1(,,,) $fSerial1(,,) $fSerial1(,)$fSerial1EitherbaseGHC.RealIntegral mtl-2.2.2-IqWgmFcHnX2E7PrBkSGNvnControl.Monad.State.ClassgetGHC.WordWord16Word32Word64bytestring-0.10.8.2Data.ByteString.Lazy.Internal ByteStringbinary-0.8.5.1Data.Binary.GetrunGetData.ByteString.Internal%cereal-0.5.5.0-6LO5PNysX75KHoEvRoBnr3Data.Serialize.GetData.Binary.PutrunPutData.Serialize.PutForeign.StorableStorable