ghc-9.2.0.20210331: The GHC API
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.Utils.Binary

Synopsis

Documentation

data Bin a Source #

Instances

Instances details
Bounded (Bin a) # 
Instance details

Defined in GHC.Utils.Binary

Show (Bin a) # 
Instance details

Defined in GHC.Utils.Binary

Methods

showsPrec :: Int -> Bin a -> ShowS Source #

show :: Bin a -> String Source #

showList :: [Bin a] -> ShowS Source #

Binary (Bin a) # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: BinHandle -> Bin a -> IO () Source #

put :: BinHandle -> Bin a -> IO (Bin (Bin a)) Source #

get :: BinHandle -> IO (Bin a) Source #

Eq (Bin a) # 
Instance details

Defined in GHC.Utils.Binary

Methods

(==) :: Bin a -> Bin a -> Bool #

(/=) :: Bin a -> Bin a -> Bool #

Ord (Bin a) # 
Instance details

Defined in GHC.Utils.Binary

Methods

compare :: Bin a -> Bin a -> Ordering #

(<) :: Bin a -> Bin a -> Bool #

(<=) :: Bin a -> Bin a -> Bool #

(>) :: Bin a -> Bin a -> Bool #

(>=) :: Bin a -> Bin a -> Bool #

max :: Bin a -> Bin a -> Bin a #

min :: Bin a -> Bin a -> Bin a #

class Binary a where Source #

Do not rely on instance sizes for general types, we use variable length encoding for many of them.

Minimal complete definition

get

Methods

put_ :: BinHandle -> a -> IO () Source #

put :: BinHandle -> a -> IO (Bin a) Source #

get :: BinHandle -> IO a Source #

Instances

Instances details
Binary SomeTypeRep # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Binary Fingerprint # 
Instance details

Defined in GHC.Utils.Binary

Binary Int16 # 
Instance details

Defined in GHC.Utils.Binary

Binary Int32 # 
Instance details

Defined in GHC.Utils.Binary

Binary Int64 # 
Instance details

Defined in GHC.Utils.Binary

Binary Int8 # 
Instance details

Defined in GHC.Utils.Binary

Binary Word16 # 
Instance details

Defined in GHC.Utils.Binary

Binary Word32 # 
Instance details

Defined in GHC.Utils.Binary

Binary Word64 # 
Instance details

Defined in GHC.Utils.Binary

Binary Word8 # 
Instance details

Defined in GHC.Utils.Binary

Binary ByteString # 
Instance details

Defined in GHC.Utils.Binary

Binary IsOrphan # 
Instance details

Defined in GHC.Core

Binary Role # 
Instance details

Defined in GHC.Core.Coercion.Axiom

Binary SrcStrictness # 
Instance details

Defined in GHC.Core.DataCon

Binary SrcUnpackedness # 
Instance details

Defined in GHC.Core.DataCon

Binary CallerCcFilter # 
Instance details

Defined in GHC.Core.Opt.CallerCC

Binary Injectivity # 
Instance details

Defined in GHC.Core.TyCon

Binary TyConBndrVis # 
Instance details

Defined in GHC.Core.TyCon

Binary FastString # 
Instance details

Defined in GHC.Utils.Binary

Binary LexicalFastString # 
Instance details

Defined in GHC.Utils.Binary

Binary NonDetFastString # 
Instance details

Defined in GHC.Utils.Binary

Binary ArgDocMap # 
Instance details

Defined in GHC.Hs.Doc

Binary DeclDocMap # 
Instance details

Defined in GHC.Hs.Doc

Binary HsDocString # 
Instance details

Defined in GHC.Hs.Doc

Binary ExtensibleFields # 
Instance details

Defined in GHC.Iface.Ext.Fields

Binary BindType # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary ContextInfo # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary DeclType # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary EvBindDeps # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary EvVarSource # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary HieFile # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary IEType # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary NodeAnnotation # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary NodeOrigin # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary RecFieldContext # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary Scope # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary TyVarScope # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary IfaceAT # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceAlt # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceAnnotation # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceAxBranch # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceBang # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceBinding # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceClassOp # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceClsInst # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceCompleteMatch # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceConAlt # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceConDecl # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceConDecls # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceDecl # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceExpr # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceFamInst # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceFamTyConFlav # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceIdDetails # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceInfoItem # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceJoinInfo # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceLFInfo # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceLetBndr # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceRule # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceSrcBang # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceTickish # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceTyConParent # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceUnfolding # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceAppArgs # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceBndr # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceCoercion # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceMCoercion # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceOneShot # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceTyCon # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceTyConInfo # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceTyConSort # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceTyLit # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceType # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceUnivCoProv # 
Instance details

Defined in GHC.Iface.Type

Binary AvailInfo # 
Instance details

Defined in GHC.Types.Avail

Binary GreName # 
Instance details

Defined in GHC.Types.Avail

Binary Activation # 
Instance details

Defined in GHC.Types.Basic

Binary FunctionOrData # 
Instance details

Defined in GHC.Types.Basic

Binary InlinePragma # 
Instance details

Defined in GHC.Types.Basic

Binary InlineSpec # 
Instance details

Defined in GHC.Types.Basic

Binary LeftOrRight # 
Instance details

Defined in GHC.Types.Basic

Binary OverlapFlag # 
Instance details

Defined in GHC.Types.Basic

Binary OverlapMode # 
Instance details

Defined in GHC.Types.Basic

Binary PromotionFlag # 
Instance details

Defined in GHC.Types.Basic

Binary RecFlag # 
Instance details

Defined in GHC.Types.Basic

Binary RuleMatchInfo # 
Instance details

Defined in GHC.Types.Basic

Binary TupleSort # 
Instance details

Defined in GHC.Types.Basic

Binary CCFlavour # 
Instance details

Defined in GHC.Types.CostCentre

Binary CostCentre # 
Instance details

Defined in GHC.Types.CostCentre

Binary CostCentreIndex # 
Instance details

Defined in GHC.Types.CostCentre.State

Binary Cpr # 
Instance details

Defined in GHC.Types.Cpr

Methods

put_ :: BinHandle -> Cpr -> IO () Source #

put :: BinHandle -> Cpr -> IO (Bin Cpr) Source #

get :: BinHandle -> IO Cpr Source #

Binary CprSig # 
Instance details

Defined in GHC.Types.Cpr

Binary CprType # 
Instance details

Defined in GHC.Types.Cpr

Binary Card # 
Instance details

Defined in GHC.Types.Demand

Binary Demand # 
Instance details

Defined in GHC.Types.Demand

Binary Divergence # 
Instance details

Defined in GHC.Types.Demand

Binary DmdType # 
Instance details

Defined in GHC.Types.Demand

Binary StrictSig # 
Instance details

Defined in GHC.Types.Demand

Binary SubDemand # 
Instance details

Defined in GHC.Types.Demand

Binary DuplicateRecordFields # 
Instance details

Defined in GHC.Types.FieldLabel

Binary Name => Binary FieldLabel #

We need the Binary Name constraint here even though there is an instance defined in GHC.Types.Name, because the we have a SOURCE import, so the instance is not in scope. And the instance cannot be added to Name.hs-boot because GHC.Utils.Binary itself depends on GHC.Types.Name.

Instance details

Defined in GHC.Types.FieldLabel

Binary FieldSelectors # 
Instance details

Defined in GHC.Types.FieldLabel

Binary Fixity # 
Instance details

Defined in GHC.Types.Fixity

Binary FixityDirection # 
Instance details

Defined in GHC.Types.Fixity

Binary CCallConv # 
Instance details

Defined in GHC.Types.ForeignCall

Binary CCallSpec # 
Instance details

Defined in GHC.Types.ForeignCall

Binary CCallTarget # 
Instance details

Defined in GHC.Types.ForeignCall

Binary CExportSpec # 
Instance details

Defined in GHC.Types.ForeignCall

Binary CType # 
Instance details

Defined in GHC.Types.ForeignCall

Binary ForeignCall # 
Instance details

Defined in GHC.Types.ForeignCall

Binary Header # 
Instance details

Defined in GHC.Types.ForeignCall

Binary Safety # 
Instance details

Defined in GHC.Types.ForeignCall

Binary LitNumType # 
Instance details

Defined in GHC.Types.Literal

Binary Literal # 
Instance details

Defined in GHC.Types.Literal

Binary Name #

Assumes that the Name is a non-binding one. See putIfaceTopBndr and getIfaceTopBndr for serializing binding Names. See UserData for the rationale for this distinction.

Instance details

Defined in GHC.Types.Name

Binary NameSpace # 
Instance details

Defined in GHC.Types.Name.Occurrence

Binary OccName # 
Instance details

Defined in GHC.Types.Name.Occurrence

Binary IfaceTrustInfo # 
Instance details

Defined in GHC.Types.SafeHaskell

Binary HscSource # 
Instance details

Defined in GHC.Types.SourceFile

Binary SourceText # 
Instance details

Defined in GHC.Types.SourceText

Binary StringLiteral # 
Instance details

Defined in GHC.Types.SourceText

Binary BufPos # 
Instance details

Defined in GHC.Utils.Binary

Binary BufSpan # 
Instance details

Defined in GHC.Utils.Binary

Binary RealSrcSpan # 
Instance details

Defined in GHC.Utils.Binary

Binary SrcSpan # 
Instance details

Defined in GHC.Utils.Binary

Binary UnhelpfulSpanReason # 
Instance details

Defined in GHC.Utils.Binary

Binary AnonArgFlag # 
Instance details

Defined in GHC.Types.Var

Binary ArgFlag # 
Instance details

Defined in GHC.Types.Var

Binary Specificity # 
Instance details

Defined in GHC.Types.Var

Binary Dependencies # 
Instance details

Defined in GHC.Unit.Module.Deps

Binary Usage # 
Instance details

Defined in GHC.Unit.Module.Deps

Binary ModIface # 
Instance details

Defined in GHC.Unit.Module.ModIface

Binary ModuleName # 
Instance details

Defined in GHC.Unit.Module.Name

Binary WarningTxt # 
Instance details

Defined in GHC.Unit.Module.Warnings

Binary Warnings # 
Instance details

Defined in GHC.Unit.Module.Warnings

Binary InstantiatedUnit # 
Instance details

Defined in GHC.Unit.Types

Binary IsBootInterface # 
Instance details

Defined in GHC.Unit.Types

Binary Unit # 
Instance details

Defined in GHC.Unit.Types

Binary UnitId # 
Instance details

Defined in GHC.Unit.Types

Binary BinData # 
Instance details

Defined in GHC.Utils.Binary

Binary Serialized # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Binary KindRep # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Binary TyCon # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Binary TypeLitSort # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Binary Day # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: BinHandle -> Day -> IO () Source #

put :: BinHandle -> Day -> IO (Bin Day) Source #

get :: BinHandle -> IO Day Source #

Binary DiffTime # 
Instance details

Defined in GHC.Utils.Binary

Binary UTCTime # 
Instance details

Defined in GHC.Utils.Binary

Binary Integer # 
Instance details

Defined in GHC.Utils.Binary

Binary () # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: BinHandle -> () -> IO () Source #

put :: BinHandle -> () -> IO (Bin ()) Source #

get :: BinHandle -> IO () Source #

Binary Bool # 
Instance details

Defined in GHC.Utils.Binary

Binary Char # 
Instance details

Defined in GHC.Utils.Binary

Binary Int # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: BinHandle -> Int -> IO () Source #

put :: BinHandle -> Int -> IO (Bin Int) Source #

get :: BinHandle -> IO Int Source #

Binary RuntimeRep # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Binary VecCount # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Binary VecElem # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Binary a => Binary (Ratio a) # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: BinHandle -> Ratio a -> IO () Source #

put :: BinHandle -> Ratio a -> IO (Bin (Ratio a)) Source #

get :: BinHandle -> IO (Ratio a) Source #

Binary a => Binary (BooleanFormula a) # 
Instance details

Defined in GHC.Data.BooleanFormula

Binary (HieAST TypeIndex) # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary (HieASTs TypeIndex) # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary (HieArgs TypeIndex) # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary (HieType TypeIndex) # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary (IdentifierDetails TypeIndex) # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary (NodeInfo TypeIndex) # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary (SourcedNodeInfo TypeIndex) # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary a => Binary (LocatedL a) # 
Instance details

Defined in GHC.Parser.Annotation

Binary name => Binary (AnnTarget name) # 
Instance details

Defined in GHC.Types.Annotations

Methods

put_ :: BinHandle -> AnnTarget name -> IO () Source #

put :: BinHandle -> AnnTarget name -> IO (Bin (AnnTarget name)) Source #

get :: BinHandle -> IO (AnnTarget name) Source #

Binary (DefMethSpec IfaceType) # 
Instance details

Defined in GHC.Iface.Type

Binary a => Binary (Located a) # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: BinHandle -> Located a -> IO () Source #

put :: BinHandle -> Located a -> IO (Bin (Located a)) Source #

get :: BinHandle -> IO (Located a) Source #

Binary unit => Binary (Definite unit) # 
Instance details

Defined in GHC.Unit.Types

Methods

put_ :: BinHandle -> Definite unit -> IO () Source #

put :: BinHandle -> Definite unit -> IO (Bin (Definite unit)) Source #

get :: BinHandle -> IO (Definite unit) Source #

Binary a => Binary (GenModule a) # 
Instance details

Defined in GHC.Unit.Types

Binary a => Binary (GenWithIsBoot a) # 
Instance details

Defined in GHC.Unit.Types

Binary unit => Binary (Indefinite unit) # 
Instance details

Defined in GHC.Unit.Types

Methods

put_ :: BinHandle -> Indefinite unit -> IO () Source #

put :: BinHandle -> Indefinite unit -> IO (Bin (Indefinite unit)) Source #

get :: BinHandle -> IO (Indefinite unit) Source #

Binary (FixedLengthEncoding Word16) # 
Instance details

Defined in GHC.Utils.Binary

Binary (FixedLengthEncoding Word32) # 
Instance details

Defined in GHC.Utils.Binary

Binary (FixedLengthEncoding Word64) # 
Instance details

Defined in GHC.Utils.Binary

Binary (FixedLengthEncoding Word8) # 
Instance details

Defined in GHC.Utils.Binary

Binary a => Binary (Maybe a) # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: BinHandle -> Maybe a -> IO () Source #

put :: BinHandle -> Maybe a -> IO (Bin (Maybe a)) Source #

get :: BinHandle -> IO (Maybe a) Source #

Binary a => Binary [a] # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: BinHandle -> [a] -> IO () Source #

put :: BinHandle -> [a] -> IO (Bin [a]) Source #

get :: BinHandle -> IO [a] Source #

(Binary a, Binary b) => Binary (Either a b) # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: BinHandle -> Either a b -> IO () Source #

put :: BinHandle -> Either a b -> IO (Bin (Either a b)) Source #

get :: BinHandle -> IO (Either a b) Source #

Typeable a => Binary (TypeRep a) # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Methods

put_ :: BinHandle -> TypeRep a -> IO () Source #

put :: BinHandle -> TypeRep a -> IO (Bin (TypeRep a)) Source #

get :: BinHandle -> IO (TypeRep a) Source #

(Ix a, Binary a, Binary b) => Binary (Array a b) # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: BinHandle -> Array a b -> IO () Source #

put :: BinHandle -> Array a b -> IO (Bin (Array a b)) Source #

get :: BinHandle -> IO (Array a b) Source #

(Binary tv, Binary vis) => Binary (VarBndr tv vis) # 
Instance details

Defined in GHC.Types.Var

Methods

put_ :: BinHandle -> VarBndr tv vis -> IO () Source #

put :: BinHandle -> VarBndr tv vis -> IO (Bin (VarBndr tv vis)) Source #

get :: BinHandle -> IO (VarBndr tv vis) Source #

Binary (Bin a) # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: BinHandle -> Bin a -> IO () Source #

put :: BinHandle -> Bin a -> IO (Bin (Bin a)) Source #

get :: BinHandle -> IO (Bin a) Source #

(Binary a, Binary b) => Binary (a, b) # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: BinHandle -> (a, b) -> IO () Source #

put :: BinHandle -> (a, b) -> IO (Bin (a, b)) Source #

get :: BinHandle -> IO (a, b) Source #

(Binary a, Binary b, Binary c) => Binary (a, b, c) # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: BinHandle -> (a, b, c) -> IO () Source #

put :: BinHandle -> (a, b, c) -> IO (Bin (a, b, c)) Source #

get :: BinHandle -> IO (a, b, c) Source #

(Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d) # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: BinHandle -> (a, b, c, d) -> IO () Source #

put :: BinHandle -> (a, b, c, d) -> IO (Bin (a, b, c, d)) Source #

get :: BinHandle -> IO (a, b, c, d) Source #

(Binary a, Binary b, Binary c, Binary d, Binary e) => Binary (a, b, c, d, e) # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: BinHandle -> (a, b, c, d, e) -> IO () Source #

put :: BinHandle -> (a, b, c, d, e) -> IO (Bin (a, b, c, d, e)) Source #

get :: BinHandle -> IO (a, b, c, d, e) Source #

(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f) => Binary (a, b, c, d, e, f) # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: BinHandle -> (a, b, c, d, e, f) -> IO () Source #

put :: BinHandle -> (a, b, c, d, e, f) -> IO (Bin (a, b, c, d, e, f)) Source #

get :: BinHandle -> IO (a, b, c, d, e, f) Source #

(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f, Binary g) => Binary (a, b, c, d, e, f, g) # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: BinHandle -> (a, b, c, d, e, f, g) -> IO () Source #

put :: BinHandle -> (a, b, c, d, e, f, g) -> IO (Bin (a, b, c, d, e, f, g)) Source #

get :: BinHandle -> IO (a, b, c, d, e, f, g) Source #

data BinData Source #

Constructors

BinData Int BinArray 

Instances

Instances details
NFData BinData # 
Instance details

Defined in GHC.Utils.Binary

Methods

rnf :: BinData -> () Source #

Binary BinData # 
Instance details

Defined in GHC.Utils.Binary

seekBin :: BinHandle -> Bin a -> IO () Source #

castBin :: Bin a -> Bin b Source #

withBinBuffer :: BinHandle -> (ByteString -> IO a) -> IO a Source #

Get access to the underlying buffer.

It is quite important that no references to the ByteString leak out of the continuation lest terrible things happen.

putAt :: Binary a => BinHandle -> Bin a -> a -> IO () Source #

getAt :: Binary a => BinHandle -> Bin a -> IO a Source #

For writing instances

Variable length encodings

putULEB128 :: forall a. (Integral a, FiniteBits a) => BinHandle -> a -> IO () Source #

getULEB128 :: forall a. (Integral a, FiniteBits a) => BinHandle -> IO a Source #

putSLEB128 :: forall a. (Integral a, Bits a) => BinHandle -> a -> IO () Source #

getSLEB128 :: forall a. (Show a, Integral a, FiniteBits a) => BinHandle -> IO a Source #

Fixed length encoding

newtype FixedLengthEncoding a Source #

Encode the argument in it's full length. This is different from many default binary instances which make no guarantee about the actual encoding and might do things use variable length encoding.

Constructors

FixedLengthEncoding 

Fields

Lazy Binary I/O

lazyPut :: Binary a => BinHandle -> a -> IO () Source #

User data

data UserData Source #

Information we keep around during interface file serialization/deserialization. Namely we keep the functions for serializing and deserializing Names and FastStrings. We do this because we actually use serialization in two distinct settings,

  • When serializing interface files themselves
  • When computing the fingerprint of an IfaceDecl (which we computing by hashing its Binary serialization)

These two settings have different needs while serializing Names:

  • Names in interface files are serialized via a symbol table (see Note [Symbol table representation of names] in GHC.Iface.Binary).
  • During fingerprinting a binding Name is serialized as the OccName and a non-binding Name is serialized as the fingerprint of the thing they represent. See Note [Fingerprinting IfaceDecls] for further discussion.

Constructors

UserData 

Fields

newReadState Source #

Arguments

:: (BinHandle -> IO Name)

how to deserialize Names

-> (BinHandle -> IO FastString) 
-> UserData 

newWriteState Source #

Arguments

:: (BinHandle -> Name -> IO ())

how to serialize non-binding Names

-> (BinHandle -> Name -> IO ())

how to serialize binding Names

-> (BinHandle -> FastString -> IO ()) 
-> UserData