úΫ·¦ö9      !"#$%&'()*+,-./012345678Safe0U&9$ without the (internal) fingerprint.!Package, module, constructor name:$ without the (internal) fingerprint.QDifferent ways of including/verifying type information of serialized messages.Include no type information.)Requires one byte more compared to using ;J directly (to tag the data as untyped, required for the decoding step).‚Encoding and decoding require negligible amount of additional computational cost compared to direct (intrinsically untyped) ;.Like , but uses a 5-bit hash value.%Requires the same amount of space as ‡, i.e. the only overhead compared to it is the computational cost to calculate the hash, which is almost identical to the one of .“Collisions occur with a probability of 1/2^5 = 1/32. For this reason, this format is only recommended when minimal data size is top priority.FCompare types by their hash values (using the MurmurHash2 algorithm).+Requires five bytes more compared to using ;5 directly for the type information (one to tag as , four for the hash value)jSubject to false positive due to hash collisions, although in practice this should almost never happen.VType errors cannot tell the provided type ("Expected X, received type with hash H")Computational cost similar to .Like , but uses a 64-bit hash value.+Requires nine bytes more compared to using ;.;Hash collisions are even less likely to occur than with .Computational cost similar to . Compare </ representation of types, obtained by calling = on the ', and also include a hash value (like f). The former is mostly for readable error messages, the latter provides better collision resistance.Data size larger than , but usually smaller than  .JBoth the hash and the shown type must match to satisfy the typechecker.aUseful type errors ("expected X, received Y"). All types are shown unqualified though, making Foo.X and Bar.Xz look identical in error messages. Remember this when you get a seemingly silly error "expected Foo, but given Foo". /Compare the full representation of a data type.More verbose than  A. As a rule of thumb, transmitted data is roughly the same as  D, but all names are fully qualified (package, module, type name).uCorrect comparison (no false positives). An semi-exception here is when types change between package versions: package-1.0 Foo.X and package-1.1 Foo.X count as the same type.aUseful type errors ("expected X, received Y"). All types are shown unqualified though, making Foo.X and Bar.Xz look identical in error messages. Remember this when you get a seemingly silly error "expected Foo, but given Foo". Like  Ž, but the type information is not checked. Useful to read type and value, and do the typechecking externally, as required by the caching of . Using %$, this can be promoted to a proper   value. OA value suitable to be typechecked using the contained extra type information.XUsing this data constructor directly is unsafe, as it allows construction of ill-typed   data. Use the !+ smart constructor unless you really need  .A 64-bit hash value.A 32-bit hash value.A 5-bit hash value.Since ' needs 3 bit to store the sort of the , the remaining 5 bit per >ˆ can be used to store a hash value at no additional space cost. For this reason, it is important that the three rightmost bits of any  are set to zero, i.e. (? 7) is @ on the contained >.'This type intentionally doesn't have a ;3 instance, since its serialization is part of the  ; instance exclusively.rType information stored alongside a value to be serialized, so that the recipient can do consistency checks. See . for more detailed information on the fields.:Pre-serialized representation of one of the other fields.Split a >` into the last 3 bit (used to tag the constructor) and the first 5 (data payload). Used by the ; instance of .Extract which  was used to create a certain .If the type is x, then the contained information is assumed well-formed. In the public API, this is safe to do, since only well-typed  * values can be created in the first place.Smart constructor for ^ values. Makes sure the rightmost three bits are not set by applying a bit mask to the input. ¯Sometimes it can be beneficial to serialize the type information in advance, so that the maybe costly serialization step does not have to be repeated on every invocation of AG. Preserialization comes at a price though, as the directly contained Bn requires its length to be included in the final serialization, yielding a 8-byte overhead for the required A, and one for the tag of what was serialized ("shown or full?").3This function calculates the serialized version of s in cases where the required 9 bytes are negligible (determined by an arbitrary threshold, currently 10*9 bytes). Used to make C more efficient; the source there also makes a good usage example.CvPreserializes type information if its encoded byte length is larger than an arbitrary threshold. Less efficient than  Z since it always preserializes and always calculates the encoded version no matter what.! Construct a  $ value using the chosen type format.Example: value = !   ("hello", 1 :: D , 2.34 :: E ) encoded = A value LThe decode site can now verify whether decoding happens with the right type." Create the  to be stored inside a   value from a :.#Extract the value of a  0, i.e. strip off the explicit type information.%This function is safe to use for all  € values created by the public API, since all construction sites ensure the actual type matches the contained type description. # (! format x) == x $ Typecheck a  S. Returns the (well-typed) input, or an error message if the types don't work out.% Typecheck a  'Typed\''# value so it can be used as a safe   value.&Hash a : to a 5-bit digest.'Hash a : to a 32-bit digest.(Hash a : to a 64-bit digest.)Strip a :! off the fingerprint. Inverse of *.*Add a fingerprint to a  . Inverse of ).+Strip a 9! off the fingerprint. Inverse of ,.,Add a fingerprint to a  . Inverse of +.F"Typed' <format> <value>"GgEnsures data is decoded as the appropriate type with high or total confidence (depending on with what  the   was constructed).H"typed <format> <value>"> I C!"#$%&'()*+,JKLMNOPQRFGHSTU-  !"#$%&'()*+,-  !" $%# )*&'(+,*  I C!"#$%&'()*+,JKLMNOPQRFGHSTUSafeN- Modify the value contained in a  I, keeping the same sort of type representation. In other words, calling -# on something that is typed using Hashed will yield a Hashed value again.Note: this destroys  *d information, so that values have to be  &d again if desired. As a consequence, - @ can be used to un-  values.. Change the value contained in a  Ñ, leaving the type representation unchanged. This can be useful to avoid recomputation of the included type information, and can improve performance significantly if many individual messages are serialized. Can be seen as a more efficient - in case f$ is an endomorphism (i.e. has type a -> a)./.Change the way a type is represented inside a   value. / format x = ! format (# x) 0 Encode a V value to BÏ that includes type information. This function is useful to create specialized typed encoding functions, because the type information is cached and does not need to be recalculated on every serialization.Observationally, 0 format value is equivalent to A (! format value) . However, 0¿ does the type information related calculations in advance and shares the results between future invocations of it, making it much more efficient to serialize many values of the same type.1-Decode a typed value, throwing a descriptive W) at runtime on failure. Typed cousin of X . Based on 3.  encoded = 0   ("hello", 1 :: D , 2.34 :: E) -- <value> 1 encoded :: (<, D, E) -- (Descriptive) runtime W 1 encoded :: (Y, D, E) 2Safely decode data, yielding Z an error < or the value. Equivalent to 3/ stripped of the non-essential data. Based on 3.  encoded = 0   ("hello", 1 :: D , 2.34 :: E) -- Right <value>: 2 encoded :: Z < (<, D, EQ) -- Left "Type error: expected (Char, Int, Double), got (String, Int, Double)" 2 encoded :: Z < (Y, D, E) 3Safely decode data, yielding Z an error <H or the value, along with meta-information of the consumed binary data.Typed cousin of [.Like 2, but with additional data.Automatically caches ,  and ^ representations, so that typechecking does not need to recalculate them on every decoding.-./0123 !#-./0123 ! #-./ 0231-./0123NoneN\ Similar to makeTypeInformation0, but prints a message each time it's forced.4.Change the way a type is represented inside a   value. 4 format x = ! format (# x) 5 Encode a V value to BÏ that includes type information. This function is useful to create specialized typed encoding functions, because the type information is cached and does not need to be recalculated on every serialization.Observationally, 5 format value is equivalent to A (! format value) . However, 5¿ does the type information related calculations in advance and shares the results between future invocations of it, making it much more efficient to serialize many values of the same type.6-Decode a typed value, throwing a descriptive W) at runtime on failure. Typed cousin of X . Based on 8.  encoded = 5   ("hello", 1 :: D , 2.34 :: E) -- <value> 6 encoded :: (<, D, E) -- (Descriptive) runtime W 6 encoded :: (Y, D, E) 7Safely decode data, yielding Z an error < or the value. Equivalent to 8/ stripped of the non-essential data. Based on 8.  encoded = 5   ("hello", 1 :: D , 2.34 :: E) -- Right <value>: 7 encoded :: Z < (<, D, EQ) -- Left "Type error: expected (Char, Int, Double), got (String, Int, Double)" 7 encoded :: Z < (Y, D, E) 8Safely decode data, yielding Z an error <H or the value, along with meta-information of the consumed binary data.Typed cousin of [.Like 7, but with additional data.Automatically caches ,  and ^ representations, so that typechecking does not need to recalculate them on every decoding.\45678 !#-.45678 ! #-.4 5786\45678Safe]        !"#$%&'()*+,-./012312345 45 67849:4;<4=>4?@49A6BCDEFGHIJHIKLMNOPQRSTUVWXYZ[45\4]^6B_HI`4ab6Bcdebinar_LYTaEIbRiAgHOoWv6yWLz1Data.Binary.Typed.InternalData.Binary.TypedData.Binary.Typed.Debug decodeTypedData.IntInt64 encodeTypedData.Binary.Typed.TutorialTyConTypeRep TypeFormatUntypedHashed5Hashed32Hashed64ShownFullTyped'TypedHash64Hash32Hash5TypeInformationUntyped'Hashed5' Hashed32' Hashed64'Shown'Full'Cached' hashed5Split getFormatmkHash5 preserializetypedmakeTypeInformationerase typecheck typecheck' hashType5 hashType32 hashType64 stripTypeRepunStripTypeRep stripTyCon unStripTyConmapTypedreValuereTypeunsafeDecodeTypeddecodeTypedOrFailbaseData.Typeable.Internalbinar_IvYoLp9H6Xy3zEH13MmZwdData.Binary.ClassBinaryGHC.BaseStringGHC.ShowshowGHC.WordWord8 Data.Bits.&.id Data.Binaryencodebytes_6elQVSg5cWdFrvRnfxTUrHData.ByteString.Lazy.Internal ByteString preserialize'ghc-prim GHC.TypesIntDouble $fShowTyped' $fBinaryTyped $fShowTyped getHashed5Tag$fHashable64TyCon$fHashable32TyCon $fShowTyCon $fBinaryTyCon$fHashable64TypeRep$fHashable32TypeRep $fShowTypeRep$fBinaryTypeRep$fBinaryTyped'$fBinaryHash64$fBinaryHash32$fBinaryTypeInformationTypeableGHC.ErrerrordecodeChar Data.EitherEither decodeOrFailmakeTypeInformationDebug