h,51      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrs0.1.0.1None )*1A buffer that contains one or more packed (i.e. serialised) values. The order of the values in the buffer is defined by the l type listt Duplicates a  buffer. The returned $ is independent from the source one.UNSAFE: Casts a generic u into a  Extracts the raw buffer from a    valueUNSAFE: Casts a typed  value into another  value of another typetvw None )*1#Options for the generation process.Beware: these options alter the signature and behaviour of the generated functions.When specified, each field in a packed data constructor will be preceded by a  :, which indicates the size of the following packed value.Example.As a consequence, for the following type, the caseTree+ function will have the following signature  caseTree :: ( (  ': a ': r) r b) -> ( (  ': Tree a ':   ': Tree a ': r) r b) ->  (Tree a ': r) r b *This flag should be used in complement to  If set, no   will be inserted before the last parameter of the data constructor.Example If this flag is set (along with  ), for the following type, the caseTree+ function will have the following signature caseTree :: ( (a ': r) r b) -> ( ( ' ': Tree a ': Tree a ': r) r b) ->  (Tree a ': r) r b None )*1 Byte in a   7 value to identify which data constructor is serialisedxSanitize constructor name so that it can be used as a symbol nameyz{xNone )*1 &Type operator to concat lists of typesNone)*1  Shortcut type for  *'s that simply write multiple values to a ' without changing the final packed type Shortcut type for  "'s that simply write a value to a ' without changing the final packed type *A wrapper around a function that builds a ps/: The type of the expected input of the source ts2: The type of the final packed data of the source pd1: The type of the expected input of the resuling td5: The type of the final packed data of the resulting Note: It is an indexed monad.A buffer where packed values can be written The order to write these values is defined by the l type listIf p( is an empty list, then a value of type t* can be extracted from that buffer. (See )Turns a 4 value (that does not expect to be written to) to a    None)*01>;Basically a function that reads/desrialises a value from a  p' the types of the packed values to readr1 the packed type after the encoded values to readv the type of the value to unpackNote: It is an indexed monad. Builds a Allows bindings " together, in a monad-like manner. Similar to  Similar to Like , wraps a value in a ! that will not consume its input.!5Allows reading another packed value in a do-notation.The reading of the second stream does not consume anything from the first.Example: import qualified Data.Packed.Reader as R data Tree a = Leaf | Node (Tree a) a (Tree a) packedTreeToList ::  '[Tree Int] '[] [Int] packedTreeToList = go [] where go l = caseTree (R.return l) ( R.do packedLeft <-  n <- $ packedRight <-  -- Using lift allows consuming the packedRight value rightList <- R.!* (go l) packedRight R.!3 (go $ n : rightList) packedLeft ) ",Run the reading function using a ByteString.#Util function that calls $ on the value produced by the input   #!" "! #None)*1%An %8 is a value that can be read (i.e. deserialised) from a    value&The  to unpack a value of that type'In a ), reads a value without moving the cursor(Deserialise a value from a  .Returns the unconsumed   portion)Same as (&, but throws away the unconsumed bytes"'()%&None)*1U,2UNSAFE: Shifts the cursor to n bytes to the right.,*+*+,None)*10./None)*111Type representation for the size of a packed data. The size is in bytes.Note: Take a look at the s to understand how to use it2%Returns the size of the packed value.Warning: For this to be accurate, there should only be one value packed in the binary strea.38Allows skipping over a field without having to unpack it4Write a value into a  , along with its 1Note: Universal quantifier is nedded for GHC < 9.10, because of ScopedTypeVariables5.Produces a reader for a value preceded by its 16 Splits the , value, and isolate the first encoded value.|265341}None )*10~For a constructor Leaf", will generate the function name  startLeaf7%Generates a function that prepares a  + to receive values from a data constructor.Example:For the Tree0 data type, it generates the following functions startLeaf :: NeedsBuilder (Tree a ': r) t (a ': r) t startLeaf = ' (n -> runBuilder (write (0 :: Word8) ( n))) startNode :: NeedsBuilder (Tree a ': r) t (Tree a ': Tree a ': r) t startNode = ' (n -> runBuilder (write (1 :: Word8) ( n))) 7=The name of the data constructor to generate the function forThe % (byte) to write for this constructor The list of %s of the data constructor's arguments7~None)*18 a -> 'NeedsWriter (Tree a) r t' writeConLeaf n = startLeaf  / n 8=The name of the data constructor to generate the function forA unique (to the data type) ) to identify the packed data constructor.For example, for a Tree0 data type, we would typically use '0' for the Leaf constructor and '1' for the Node constructor8None )*19?Generates a function that serialises and writes a value into a 5The function simply calls the functions generated by Example:For the Tree/ data type, it generates the following function writeTree :: (. a) => Tree a ->   (Tree a) r t writeTree (Leaf n) = writeConLeaf n writeTree (Node l r) = writeConNode l r 91The name of the type to generate the function for9 None )*1 :Generates an instance of . for the given type>All the parameters of each constructor should be instances of .?Note: The pack function simply calls the function generated by 9ExampleFor the Tree0 data type, it generates the following instance:  instance (. a) => .& (Tree a) where write = writeTree :1The name of the type to generate the instance for:!None )*1";Generates a function that serialises an applied data constructor.The function calls the functions generated by Example:For the Tree0 data type, it generates the following functions  packLeaf :: (. a) => a ->    '[Tree a] packLeaf n =  ( (writeLeaf n)) packNode :: (. a) => Tree a -> Tree a ->    '[Tree a] packNode t1 t2 =  ( (writeNode t1 t2)) ;"None )*1$<Generates a function that builds back data using already serialised fieldsExample:For the Tree0 data type, it generates the following functions repackLeaf ::   '[] a ->  ? '[] (Tree a) repackLeaf pval = withEmptyNeeds (startLeaf N.>> # pval) repackNode ::   '[] (Tree a) ->   '[] (Tree a) ->   '[] (Tree a) repackNode lval rval = withEmptyNeeds (startNode N.>>  concatNeeds lval N.>>  concatNeeds rval) <$None)*1'%=Generates a function to allow pattern matching a packed data type using the data constructorsExample:For the Tree0 data type, it generates the following function: caseTree :: ( '[a] r b) -> ( '[Tree a, Tree a] r b) -> , '[Tree a] r b caseTree leafCase nodeCase = % $ packed l -> do (tag :: , packed1, l1) <- & '% packed l case tag of 0 -> &! leafCase packed1 l1 1 -> &0 nodeCase packed1 l1 _ -> fail "Bad Tag" =1The name of the type to generate the function for=(None )*1'For a constructor Leaf", will generate the function name  transformLeaf>)None )*1)?=Generates an function to skip a value of the given type in a  Example:For the Tree0 data type, it generates the following function:  skipTree :: (* a) => ) '[Tree a] r () skipTree = caseTree +, (skipTree >> skipTree) ?-None )*1*O@Generates an instance of * for the given type>All the parameters of each constructor should be instances of *ExampleFor the Tree0 data type, it generates the following instance:  instance (* a) => *$ (Tree a) where skip = skipTree @.None )*1-HAGenerates an function to read (i.e. deserialise) the given data type.Example:For the Tree0 data type, it generates the following function:  readTree :: (% a) => / '[Tree a] r (Tree a) readTree = caseTree (' >>= \leafContent ->  $ Leaf leafContent ) (' >>= \leftContent -> ' >>= \rightContent -> ' $ Node leftContent rightContent ) Note We use bindings (!) intead of a do-notation, since / is not a monad. It's an indexed monad, meaning that the user would have to enable the  extenstion for it to compile.A1The name of the type to generate the function forA0None )*1.BGenerates an instance of % for the given type>All the parameters of each constructor should be instances of %Note: The unpack function simply calls the function generated by AExampleFor the Tree0 data type, it generates the following instance:  instance (% a) => %% (Tree a) where reader = readTree BNone )*10oC)Generate the following for the given typeA 'case' function (see =)An instance of 1 (see :)An instance of 2 (see B)An instance of * (see @)Example:  $(C ''Tree [3]) C2The name of the type to generate the functions forGeneration customisation flagsC=;:AB98C=:;<987BA@?>None)*10'dDTLK\k[ljJZNM^m]noO_GEWeUgpP`HFXfVhiIY'DEFGHIJKLMNOPTUVWXYZ[\]^_`defghijklmnopNone )*11@265340"C'()1./*+%&./0%&'()436"5C12*+4None )*115None )*11 678  3 9:;<=>>>?  @ABC#DEF%GH&IJ2'KLM*,NO1PQ RSTUV W!X"Y$Z([)\-].^0_`abcdefghijklmnopqrstuvwxyz{|}~  $().44444444555555*packed-data-0.1.0.1-L4ISHP2dgvCEJh2Vh5Xi8G Data.PackedData.Packed.THData.Packed.NeedsData.Packed.ReaderData.Packed.SkippableData.Packed.Instances packed-dataData.Packed.PackedNeedsDataPackedData.Packed.TH.Flag FieldSize PackedReaderData.Packed.TH.UtilsData.Packed.UtilsPrelude>>=>>returnisolatereaderWithFieldSizefinishData.Packed.UnpackableData.Packed.PackableData.Packed.FieldSize PackingFlagData.Packed.TH.StartData.Packed.TH.WriteConData.Packed.TH.Write genConWriteData.Packed.TH.PackableData.Packed.TH.PackConData.Packed.TH.RepackCon concatNeedsData.Packed.TH.CasemkPackedReader runReaderreaderData.Packed.TH.TransformData.Packed.TH.Skip SkippableData.Packed.SkipskipData.Packed.TH.SkippableData.Packed.TH.ReadReaderData.Packed.TH.UnpackablePackable UnpackableInsertFieldSizePaths_packed_dataTreeunsafeToPacked fromPackedunsafeCastPackedSkipLastFieldSizeTag:++: NeedsWriter' NeedsWriter NeedsBuilder runBuilderunsafeCastNeedsmkNeedsBuilderwithEmptyNeeds withNeeds applyNeedsrunPackedReader ReaderPtrfaillift finishReader$fFunctorPackedReaderreaderWithoutShiftunpackunpack' unsafeSkipN $fSkippableawritepackgetFieldSizeFromPackedskipWithFieldSizewriteWithFieldSizegenStartgenWritegenPackableInstancegenConstructorPackersgenConstructorRepackersgenCase genTransformgenSkipgenSkippableInstancegenReadgenUnpackableInstancemkPackedcaseList start9193 writeCon9193start58 writeCon58 writeListreadListpack9193pack58 repack9193repack58skipList transformList$fSkippableList$fUnpackableList$fPackableList caseMaybe startNothingwriteConNothing startJust writeConJust writeMaybe readMaybe packNothingpackJust repackNothing repackJust skipMaybetransformMaybe$fSkippableMaybe$fUnpackableMaybe$fPackableMaybe caseEither startLeft writeConLeft startRight writeConRight writeEither readEitherpackLeft packRight repackLeft repackRight skipEithertransformEither$fSkippableEither$fUnpackableEither$fPackableEither duplicatebytestring-0.12.1.0-5f32Data.ByteString.Internal.Type ByteStringunsafeToPacked'sanitizeConNamegetNameAndBangTypesFromCon getParentTypeFromConstructorTyperesolveAppliedTypeapplyNeedsWithFieldSize startFNametemplate-haskellLanguage.Haskell.TH.SyntaxType conWriteFName writeFName caseFNametransformFName skipFNameghc-boot-th-9.10.1-5379GHC.LanguageExtensions.Type QualifiedDo readFName getBinDir getDataDirgetDataFileName getDynLibDir getLibDir getLibexecDir getSysconfDirversioncaseTreereadTreeLeafNode