HE/      !"#$%&'()*+,-.(c) Jost Berthold, 2010-2015,BSD3jost.berthold@gmail.com experimentalno (depends on GHC internals)None1DQ Packing exception codes, matching error codes implemented in the runtime system or describing errors which can occur within Haskell.=no error, ==0. Internal code, should never be seen by users.DRTS: packing hit a blackhole. Used internally, not passed to users.RTS: buffer too small9RTS: contains closure which cannot be packed (MVar, TVar)?RTS: contains unsupported closure type (implementation missing)7RTS: impossible case (stack frame, message,...RTS bug!)'RTS: corrupted data for deserialisation(Haskell: Packet data could not be parsed )Haskell: Executable binaries do not match ,Haskell: Packet data encodes unexpected type  decodes an / to a &. Magic constants are read from file cbits/Errors.h. -internal: checks if the given code indicates      (c) Jost Berthold, 2010-2015,BSD3'Jost Berthold <jost.berthold@gmail.com> experimentalno (depends on GHC internals)NoneDV1- NThe target word size is the size of a machine word on the platform we run on.XThis type is only used in Binary, Read and Show instances, where packets are stored as UArrays of .nActually, GHC uses machine word size (as Haskell 2010 spec. does not fix it) so we could just use Word. See khttp://www.haskell.org/ghc/docs/7.8.3/html/users_guide/bugs-and-infelicities.html#haskell-98-2010-undefined[The module uses a custom GHC fingerprint type with its two Word64 fields, to be able to read fingerprints*The type of Serialized data. Phantom type a3 ensures that we unpack data as the expected type.>Helper to show a serialized structure as a packet (Word Array)1Packet Parser, reads the format generated by the Read instance. Could also consume other formats of the array (not implemented). Returns: (data size in words, type fingerprint, array values)Mchecks whether the type of the given expression matches the given Fingerprint creates an  from a GHC  Fingerprint -returns the type fingerprint of an expression!To check that the program (executable) is identical when packing and unpacking, the fingerprint type from above is used (Read/Show instances required). An y fingerprint of the executable is computed once, by unsafePerformIO inside this CAF (safe to inline, just inefficient).#"Reads the format generated by the 0{ instance, checks hash values for executable and type and parses exactly as much as the included data size announces.$[Binary instance for fingerprint data (encoding TypeRep and executable in binary-encoded  Serialized a)%The binary format of  a data includes FingerPrint hash values for type and executable binary, which are checked when reading Serialized data back in using get.&*prints packet as Word array in 4 columns (Wordt meaning the machine word size), and additionally includes Fingerprint hash values for executable binary and type. !"&#% $!"(c) Jost Berthold, 2010-2015,BSD3jost.berthold@gmail.com experimentalno (depends on GHC internals)None D@@1gserialisation primitive, implemented in C. Returns: a status/error code and size used inside the array*Serialises its argument (in current evaluation state, as a thunk). May block if the argument captures (blackhole'd) data under evaluation, may throw Es to signal errors. This version uses a default buffer of 10MB (see ++ for a version with flexible buffer size).2(default buffer size used by trySerialize+Extended serialisation interface: Allocates a buffer of given size (in bytes), serialises data into it, then truncates the buffer to the required size before returning it (as  a)3Score routine. Packs x into mutable byte array buf, returns size of packed x in buf4Acalls primitive, decodes/throws errors + wraps Int# size into Int,$Deserialisation function. May throw  *+,*+,(c) Jost Berthold, 2010-2015,BSD3jost.berthold@gmail.com experimentalno (depends on GHC internals)NoneVEl-;Write serialised binary data directly to a file. May throw s..=Directly read binary serialised data from a file. May throw Ks (catches I/O and Binary exceptions from decoding the file and re-throws ) *+,-.*+, -.5      !"#$%&'()*+,-./0123456789:;<$packman-0.5.0-54p7KSHd89P9uOGW8NUMTrGHC.Packing.PackExceptionGHC.Packing.TypeGHC.Packing.Core GHC.Packing PackException P_SUCCESS P_BLACKHOLE P_NOBUFFER P_CANNOTPACK P_UNSUPPORTED P_IMPOSSIBLE P_GARBLED P_ParseErrorP_BinaryMismatchP_TypeMismatchdecodeExisBHExc$fExceptionPackException$fShowPackException$fEqPackException$fOrdPackException TargetWordFP Serialized packetData showWArrayparsePdigitcolontabSpacenewlinehexNummatchestoFPtypeFPprgHash hexWordFmt$fReadSerialized $fBinaryFP$fBinarySerialized$fShowSerialized$fReadFP$fShowFP$fEqFP trySerializetrySerializeWith deserialize encodeToFiledecodeFromFileghc-primGHC.PrimInt#baseGHC.ShowShowtryPack#defaultBufSizetrySerializeIntotryPack