ghc-lib-parser-0.20190523: The GHC API, decoupled from GHC versions

Safe HaskellSafe
LanguageHaskell2010

GHC.Serialized

Synopsis

Main Serialized data type

data Serialized Source #

Represents a serialized value of a particular type. Attempts can be made to deserialize it at certain types

Constructors

Instances
Instance details

Defined in GHCi.TH.Binary

Instance details

Defined in Outputable

Instance details

Defined in Binary

Going into and out of Serialized

toSerialized :: forall a. Typeable a => (a -> [Word8]) -> a -> Serialized Source #

Put a Typeable value that we are able to actually turn into bytes into a Serialized value ready for deserialization later

fromSerialized :: forall a. Typeable a => ([Word8] -> a) -> Serialized -> Maybe a Source #

If the Serialized value contains something of the given type, then use the specified deserializer to return Just that. Otherwise return Nothing.

Handy serialization functions

serializeWithData :: Data a => a -> [Word8] Source #

Use a Data instance to implement a serialization scheme dual to that of deserializeWithData

deserializeWithData :: Data a => [Word8] -> a Source #

Use a Data instance to implement a deserialization scheme dual to that of serializeWithData

AltStyle によって変換されたページ (->オリジナル) /