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

GHC.Utils.Binary

Synopsis

Documentation

data Bin a Source #

Instances

Instances details
Bounded (Bin a) Source # 
Instance details

Defined in GHC.Utils.Binary

Show (Bin a) Source # 
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) Source # 
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) Source # 
Instance details

Defined in GHC.Utils.Binary

Methods

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

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

Ord (Bin a) Source # 
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 Source # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Binary Fingerprint Source # 
Instance details

Defined in GHC.Utils.Binary

Binary Int16 Source # 
Instance details

Defined in GHC.Utils.Binary

Binary Int32 Source # 
Instance details

Defined in GHC.Utils.Binary

Binary Int64 Source # 
Instance details

Defined in GHC.Utils.Binary

Binary Int8 Source # 
Instance details

Defined in GHC.Utils.Binary

Binary Word16 Source # 
Instance details

Defined in GHC.Utils.Binary

Binary Word32 Source # 
Instance details

Defined in GHC.Utils.Binary

Binary Word64 Source # 
Instance details

Defined in GHC.Utils.Binary

Binary Word8 Source # 
Instance details

Defined in GHC.Utils.Binary

Binary ByteString Source # 
Instance details

Defined in GHC.Utils.Binary

Binary IsOrphan Source # 
Instance details

Defined in GHC.Core

Binary Role Source # 
Instance details

Defined in GHC.Core.Coercion.Axiom

Binary SrcStrictness Source # 
Instance details

Defined in GHC.Core.DataCon

Binary SrcUnpackedness Source # 
Instance details

Defined in GHC.Core.DataCon

Binary CallerCcFilter Source # 
Instance details

Defined in GHC.Core.Opt.CallerCC

Binary NamePattern Source # 
Instance details

Defined in GHC.Core.Opt.CallerCC

Binary Injectivity Source # 
Instance details

Defined in GHC.Core.TyCon

Binary TyConBndrVis Source # 
Instance details

Defined in GHC.Core.TyCon

Binary FastString Source # 
Instance details

Defined in GHC.Utils.Binary

Binary LexicalFastString Source # 
Instance details

Defined in GHC.Utils.Binary

Binary NonDetFastString Source # 
Instance details

Defined in GHC.Utils.Binary

Binary ArgDocMap Source # 
Instance details

Defined in GHC.Hs.Doc

Binary DeclDocMap Source # 
Instance details

Defined in GHC.Hs.Doc

Binary HsDocString Source # 
Instance details

Defined in GHC.Hs.Doc

Binary ExtensibleFields Source # 
Instance details

Defined in GHC.Iface.Ext.Fields

Binary BindType Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary ContextInfo Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary DeclType Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary EvBindDeps Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary EvVarSource Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary HieFile Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary IEType Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary NodeAnnotation Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary NodeOrigin Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary RecFieldContext Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary Scope Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary TyVarScope Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary IfaceAT Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceAlt Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceAnnotation Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceAxBranch Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceBang Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceBinding Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceClassOp Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceClsInst Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceCompleteMatch Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceConAlt Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceConDecl Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceConDecls Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceDecl Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceExpr Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceFamInst Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceFamTyConFlav Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceIdDetails Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceInfoItem Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceJoinInfo Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceLFInfo Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceLetBndr Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceRule Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceSrcBang Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceTickish Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceTyConParent Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceUnfolding Source # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceAppArgs Source # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceBndr Source # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceCoercion Source # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceMCoercion Source # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceOneShot Source # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceTyCon Source # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceTyConInfo Source # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceTyConSort Source # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceTyLit Source # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceType Source # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceUnivCoProv Source # 
Instance details

Defined in GHC.Iface.Type

Binary AvailInfo Source # 
Instance details

Defined in GHC.Types.Avail

Binary GreName Source # 
Instance details

Defined in GHC.Types.Avail

Binary Activation Source # 
Instance details

Defined in GHC.Types.Basic

Binary FunctionOrData Source # 
Instance details

Defined in GHC.Types.Basic

Binary InlinePragma Source # 
Instance details

Defined in GHC.Types.Basic

Binary InlineSpec Source # 
Instance details

Defined in GHC.Types.Basic

Binary LeftOrRight Source # 
Instance details

Defined in GHC.Types.Basic

Binary OverlapFlag Source # 
Instance details

Defined in GHC.Types.Basic

Binary OverlapMode Source # 
Instance details

Defined in GHC.Types.Basic

Binary PromotionFlag Source # 
Instance details

Defined in GHC.Types.Basic

Binary RecFlag Source # 
Instance details

Defined in GHC.Types.Basic

Binary RuleMatchInfo Source # 
Instance details

Defined in GHC.Types.Basic

Binary TupleSort Source # 
Instance details

Defined in GHC.Types.Basic

Binary CCFlavour Source # 
Instance details

Defined in GHC.Types.CostCentre

Binary CostCentre Source # 
Instance details

Defined in GHC.Types.CostCentre

Binary CostCentreIndex Source # 
Instance details

Defined in GHC.Types.CostCentre.State

Binary Cpr Source # 
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 Source # 
Instance details

Defined in GHC.Types.Cpr

Binary CprType Source # 
Instance details

Defined in GHC.Types.Cpr

Binary Card Source # 
Instance details

Defined in GHC.Types.Demand

Binary Demand Source # 
Instance details

Defined in GHC.Types.Demand

Binary Divergence Source # 
Instance details

Defined in GHC.Types.Demand

Binary DmdType Source # 
Instance details

Defined in GHC.Types.Demand

Binary StrictSig Source # 
Instance details

Defined in GHC.Types.Demand

Binary SubDemand Source # 
Instance details

Defined in GHC.Types.Demand

Binary DuplicateRecordFields Source # 
Instance details

Defined in GHC.Types.FieldLabel

Binary Name => Binary FieldLabel Source #

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 Source # 
Instance details

Defined in GHC.Types.FieldLabel

Binary Fixity Source # 
Instance details

Defined in GHC.Types.Fixity

Binary FixityDirection Source # 
Instance details

Defined in GHC.Types.Fixity

Binary CCallConv Source # 
Instance details

Defined in GHC.Types.ForeignCall

Binary CCallSpec Source # 
Instance details

Defined in GHC.Types.ForeignCall

Binary CCallTarget Source # 
Instance details

Defined in GHC.Types.ForeignCall

Binary CExportSpec Source # 
Instance details

Defined in GHC.Types.ForeignCall

Binary CType Source # 
Instance details

Defined in GHC.Types.ForeignCall

Binary ForeignCall Source # 
Instance details

Defined in GHC.Types.ForeignCall

Binary Header Source # 
Instance details

Defined in GHC.Types.ForeignCall

Binary Safety Source # 
Instance details

Defined in GHC.Types.ForeignCall

Binary LitNumType Source # 
Instance details

Defined in GHC.Types.Literal

Binary Literal Source # 
Instance details

Defined in GHC.Types.Literal

Binary Name Source #

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 Source # 
Instance details

Defined in GHC.Types.Name.Occurrence

Binary OccName Source # 
Instance details

Defined in GHC.Types.Name.Occurrence

Binary IfaceTrustInfo Source # 
Instance details

Defined in GHC.Types.SafeHaskell

Binary HscSource Source # 
Instance details

Defined in GHC.Types.SourceFile

Binary SourceText Source # 
Instance details

Defined in GHC.Types.SourceText

Binary StringLiteral Source # 
Instance details

Defined in GHC.Types.SourceText

Binary BufPos Source # 
Instance details

Defined in GHC.Utils.Binary

Binary BufSpan Source # 
Instance details

Defined in GHC.Utils.Binary

Binary RealSrcSpan Source # 
Instance details

Defined in GHC.Utils.Binary

Binary SrcSpan Source # 
Instance details

Defined in GHC.Utils.Binary

Binary UnhelpfulSpanReason Source # 
Instance details

Defined in GHC.Utils.Binary

Binary AnonArgFlag Source # 
Instance details

Defined in GHC.Types.Var

Binary ArgFlag Source # 
Instance details

Defined in GHC.Types.Var

Binary Specificity Source # 
Instance details

Defined in GHC.Types.Var

Binary Dependencies Source # 
Instance details

Defined in GHC.Unit.Module.Deps

Binary Usage Source # 
Instance details

Defined in GHC.Unit.Module.Deps

Binary ModIface Source # 
Instance details

Defined in GHC.Unit.Module.ModIface

Binary ModuleName Source # 
Instance details

Defined in GHC.Unit.Module.Name

Binary WarningTxt Source # 
Instance details

Defined in GHC.Unit.Module.Warnings

Binary Warnings Source # 
Instance details

Defined in GHC.Unit.Module.Warnings

Binary InstantiatedUnit Source # 
Instance details

Defined in GHC.Unit.Types

Binary IsBootInterface Source # 
Instance details

Defined in GHC.Unit.Types

Binary Unit Source # 
Instance details

Defined in GHC.Unit.Types

Binary UnitId Source # 
Instance details

Defined in GHC.Unit.Types

Binary BinData Source # 
Instance details

Defined in GHC.Utils.Binary

Binary Serialized Source # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Binary KindRep Source # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Binary TyCon Source # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Binary TypeLitSort Source # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Binary Day Source # 
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 Source # 
Instance details

Defined in GHC.Utils.Binary

Binary UTCTime Source # 
Instance details

Defined in GHC.Utils.Binary

Binary Integer Source # 
Instance details

Defined in GHC.Utils.Binary

Binary () Source # 
Instance details

Defined in GHC.Utils.Binary

Methods

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

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

get :: BinHandle -> IO () Source #

Binary Bool Source # 
Instance details

Defined in GHC.Utils.Binary

Binary Char Source # 
Instance details

Defined in GHC.Utils.Binary

Binary Int Source # 
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 Source # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Binary VecCount Source # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Binary VecElem Source # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Binary a => Binary (Ratio a) Source # 
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) Source # 
Instance details

Defined in GHC.Data.BooleanFormula

Binary (HieAST TypeIndex) Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary (HieASTs TypeIndex) Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary (HieArgs TypeIndex) Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary (HieType TypeIndex) Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary (IdentifierDetails TypeIndex) Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary (NodeInfo TypeIndex) Source # 
Instance details

Defined in GHC.Iface.Ext.Types

Binary (SourcedNodeInfo TypeIndex) Source # 
Instance details

Defined in GHC.Iface.Ext.Types

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

Defined in GHC.Parser.Annotation

Binary name => Binary (AnnTarget name) Source # 
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) Source # 
Instance details

Defined in GHC.Iface.Type

Binary a => Binary (Located a) Source # 
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) Source # 
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) Source # 
Instance details

Defined in GHC.Unit.Types

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

Defined in GHC.Unit.Types

Binary unit => Binary (Indefinite unit) Source # 
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) Source # 
Instance details

Defined in GHC.Utils.Binary

Binary (FixedLengthEncoding Word32) Source # 
Instance details

Defined in GHC.Utils.Binary

Binary (FixedLengthEncoding Word64) Source # 
Instance details

Defined in GHC.Utils.Binary

Binary (FixedLengthEncoding Word8) Source # 
Instance details

Defined in GHC.Utils.Binary

Binary a => Binary (Maybe a) Source # 
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] Source # 
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) Source # 
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) Source # 
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) Source # 
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) Source # 
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) Source # 
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) Source # 
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) Source # 
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) Source # 
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) Source # 
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) Source # 
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) Source # 
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 Source # 
Instance details

Defined in GHC.Utils.Binary

Methods

rnf :: BinData -> () Source #

Binary BinData Source # 
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