ghc-lib-parser-9.14.1.20251220: The GHC API, decoupled from GHC versions
Safe HaskellIgnore
LanguageGHC2021

GHC.Utils.Binary

Synopsis

Documentation

data Bin (a :: k) #

Instances

Instances details
Bounded (Bin a) # 
Instance details

Defined in GHC.Utils.Binary

Methods

minBound :: Bin a #

maxBound :: Bin a #

Show (Bin a) # 
Instance details

Defined in GHC.Utils.Binary

Methods

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

show :: Bin a -> String #

showList :: [Bin a] -> ShowS #

Binary (Bin a) # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: WriteBinHandle -> Bin a -> IO () #

put :: WriteBinHandle -> Bin a -> IO (Bin (Bin a)) #

get :: ReadBinHandle -> IO (Bin a) #

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 #

data RelBin (a :: k) #

Like a Bin but is used to store relative offset pointers. Relative offset pointers store a relative location, but also contain an anchor that allow to obtain the absolute offset.

Constructors

RelBin 

Fields

Instances

Instances details
Bounded (RelBin a) # 
Instance details

Defined in GHC.Utils.Binary

Methods

minBound :: RelBin a #

maxBound :: RelBin a #

Show (RelBin a) # 
Instance details

Defined in GHC.Utils.Binary

Methods

showsPrec :: Int -> RelBin a -> ShowS #

show :: RelBin a -> String #

showList :: [RelBin a] -> ShowS #

Eq (RelBin a) # 
Instance details

Defined in GHC.Utils.Binary

Methods

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

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

Ord (RelBin a) # 
Instance details

Defined in GHC.Utils.Binary

Methods

compare :: RelBin a -> RelBin a -> Ordering #

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

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

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

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

max :: RelBin a -> RelBin a -> RelBin a #

min :: RelBin a -> RelBin a -> RelBin a #

getRelBin :: forall {k} (a :: k). ReadBinHandle -> IO (RelBin a) #

Read a relative offset location and wrap it in RelBin.

The resulting RelBin can be translated into an absolute offset location using makeAbsoluteBin

class Binary a where #

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

Minimal complete definition

get

Methods

put_ :: WriteBinHandle -> a -> IO () #

put :: WriteBinHandle -> a -> IO (Bin a) #

get :: ReadBinHandle -> IO a #

Instances

Instances details
Binary ByteString # 
Instance details

Defined in GHC.Utils.Binary

Binary ShortByteString # 
Instance details

Defined in GHC.Utils.Binary

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

Defined in GHC.Core

Binary StrictnessMark # 
Instance details

Defined in GHC.Core.DataCon

Binary CallerCcFilter # 
Instance details

Defined in GHC.Core.Opt.CallerCC.Types

Binary NamePattern # 
Instance details

Defined in GHC.Core.Opt.CallerCC.Types

Binary CoSel # 
Instance details

Defined in GHC.Core.TyCo.Rep

Binary UnivCoProvenance # 
Instance details

Defined in GHC.Core.TyCo.Rep

Binary Injectivity # 
Instance details

Defined in GHC.Core.TyCon

Binary PrimElemRep # 
Instance details

Defined in GHC.Core.TyCon

Binary PrimRep # 
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 Language # 
Instance details

Defined in GHC.Driver.Flags

Binary DocStructureItem # 
Instance details

Defined in GHC.Hs.Doc

Binary Docs # 
Instance details

Defined in GHC.Hs.Doc

Binary HsDocString # 
Instance details

Defined in GHC.Hs.DocString

Binary HsDocStringChunk # 
Instance details

Defined in GHC.Hs.DocString

Binary HsDocStringDecorator # 
Instance details

Defined in GHC.Hs.DocString

Binary ExtensibleFields # 
Instance details

Defined in GHC.Iface.Ext.Fields

Binary IfaceCppOptions # 
Instance details

Defined in GHC.Iface.Flags

Binary IfaceDynFlags # 
Instance details

Defined in GHC.Iface.Flags

Binary IfaceExtension # 
Instance details

Defined in GHC.Iface.Flags

Binary IfaceGeneralFlag # 
Instance details

Defined in GHC.Iface.Flags

Binary IfaceLanguage # 
Instance details

Defined in GHC.Iface.Flags

Binary IfaceProfAuto # 
Instance details

Defined in GHC.Iface.Flags

Binary IfaceSelfRecomp # 
Instance details

Defined in GHC.Iface.Recomp.Types

Binary IfGuidance # 
Instance details

Defined in GHC.Iface.Syntax

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 IfaceBooleanFormula # 
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 IfaceDefault # 
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 IfaceImport # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceInfoItem # 
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 IfaceMaybeRhs # 
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 IfaceStringLiteral # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceTickish # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceTopBndrInfo # 
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 IfaceWarningTxt # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfaceWarnings # 
Instance details

Defined in GHC.Iface.Syntax

Binary ImpIfaceList # 
Instance details

Defined in GHC.Iface.Syntax

Binary IfLclName # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceAppArgs # 
Instance details

Defined in GHC.Iface.Type

Binary IfaceAxiomRule # 
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 Ident # 
Instance details

Defined in GHC.StgToJS.Object

Binary AOp # 
Instance details

Defined in GHC.StgToJS.Object

Methods

put_ :: WriteBinHandle -> AOp -> IO () #

put :: WriteBinHandle -> AOp -> IO (Bin AOp) #

get :: ReadBinHandle -> IO AOp #

Binary JExpr # 
Instance details

Defined in GHC.StgToJS.Object

Binary JStat # 
Instance details

Defined in GHC.StgToJS.Object

Binary JVal # 
Instance details

Defined in GHC.StgToJS.Object

Binary Op # 
Instance details

Defined in GHC.StgToJS.Object

Methods

put_ :: WriteBinHandle -> Op -> IO () #

put :: WriteBinHandle -> Op -> IO (Bin Op) #

get :: ReadBinHandle -> IO Op #

Binary UOp # 
Instance details

Defined in GHC.StgToJS.Object

Methods

put_ :: WriteBinHandle -> UOp -> IO () #

put :: WriteBinHandle -> UOp -> IO (Bin UOp) #

get :: ReadBinHandle -> IO UOp #

Binary Serialized # 
Instance details

Defined in GHC.Utils.Binary.Typeable

Binary TagInfo # 
Instance details

Defined in GHC.Stg.EnforceEpt.TagSig

Binary TagSig # 
Instance details

Defined in GHC.Stg.EnforceEpt.TagSig

Binary BlockDeps # 
Instance details

Defined in GHC.StgToJS.Object

Binary BlockInfo # 
Instance details

Defined in GHC.StgToJS.Object

Binary ExportedFun # 
Instance details

Defined in GHC.StgToJS.Object

Binary IndexEntry # 
Instance details

Defined in GHC.StgToJS.Object

Binary JSOptions # 
Instance details

Defined in GHC.StgToJS.Object

Binary CILayout # 
Instance details

Defined in GHC.StgToJS.Object

Binary CIRegs # 
Instance details

Defined in GHC.StgToJS.Object

Binary CIStatic # 
Instance details

Defined in GHC.StgToJS.Object

Binary CIType # 
Instance details

Defined in GHC.StgToJS.Object

Binary ClosureInfo # 
Instance details

Defined in GHC.StgToJS.Object

Binary ExpFun # 
Instance details

Defined in GHC.StgToJS.Object

Binary ForeignJSRef # 
Instance details

Defined in GHC.StgToJS.Object

Binary JSFFIType # 
Instance details

Defined in GHC.StgToJS.Object

Binary JSRep # 
Instance details

Defined in GHC.StgToJS.Object

Binary StaticArg # 
Instance details

Defined in GHC.StgToJS.Object

Binary StaticInfo # 
Instance details

Defined in GHC.StgToJS.Object

Binary StaticLit # 
Instance details

Defined in GHC.StgToJS.Object

Binary StaticUnboxed # 
Instance details

Defined in GHC.StgToJS.Object

Binary StaticVal # 
Instance details

Defined in GHC.StgToJS.Object

Binary AvailInfo # 
Instance details

Defined in GHC.Types.Avail

Binary DetOrdAvails # 
Instance details

Defined in GHC.Types.Avail

Binary Activation # 
Instance details

Defined in GHC.Types.Basic

Binary CbvMark # 
Instance details

Defined in GHC.Types.Basic

Binary FunctionOrData # 
Instance details

Defined in GHC.Types.Basic

Binary ImportLevel # 
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 Levity # 
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 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 TypeOrConstraint # 
Instance details

Defined in GHC.Types.Basic

Binary UnfoldingSource # 
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_ :: WriteBinHandle -> Cpr -> IO () #

put :: WriteBinHandle -> Cpr -> IO (Bin Cpr) #

get :: ReadBinHandle -> IO Cpr #

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

Defined in GHC.Types.Demand

Binary DmdSig # 
Instance details

Defined in GHC.Types.Demand

Binary DmdType # 
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 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 ImpDeclSpec # 
Instance details

Defined in GHC.Types.Name.Reader

Binary PkgQual # 
Instance details

Defined in GHC.Types.PkgQual

Binary IfaceTrustInfo # 
Instance details

Defined in GHC.Types.SafeHaskell

Binary SaneDouble # 
Instance details

Defined in GHC.Types.SaneDouble

Binary HscSource # 
Instance details

Defined in GHC.Types.SourceFile

Binary SourceText # 
Instance details

Defined in GHC.Types.SourceText

Binary UnhelpfulSpanReason # 
Instance details

Defined in GHC.Utils.Binary

Binary FunTyFlag # 
Instance details

Defined in GHC.Types.Var

Binary Dependencies # 
Instance details

Defined in GHC.Unit.Module.Deps

Binary HomeModImport # 
Instance details

Defined in GHC.Unit.Module.Deps

Binary HomeModImportedAvails # 
Instance details

Defined in GHC.Unit.Module.Deps

Binary IfaceImportLevel # 
Instance details

Defined in GHC.Unit.Module.Deps

Binary Usage # 
Instance details

Defined in GHC.Unit.Module.Deps

Binary IfaceAbiHashes # 
Instance details

Defined in GHC.Unit.Module.ModIface

Binary IfaceModInfo # 
Instance details

Defined in GHC.Unit.Module.ModIface

Binary IfaceSimplifiedCore # 
Instance details

Defined in GHC.Unit.Module.ModIface

Binary IfaceTopEnv # 
Instance details

Defined in GHC.Unit.Module.ModIface

Binary ModIface # 
Instance details

Defined in GHC.Unit.Module.ModIface

Binary WarningCategory # 
Instance details

Defined in GHC.Unit.Module.Warnings

Binary IfaceCLabel # 
Instance details

Defined in GHC.Unit.Module.WholeCoreBindings

Binary IfaceCStubs # 
Instance details

Defined in GHC.Unit.Module.WholeCoreBindings

Binary IfaceForeign # 
Instance details

Defined in GHC.Unit.Module.WholeCoreBindings

Binary IfaceForeignFile # 
Instance details

Defined in GHC.Unit.Module.WholeCoreBindings

Binary InstantiatedUnit # 
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 BinSpan # 
Instance details

Defined in GHC.Utils.Binary

Binary BinSrcSpan # 
Instance details

Defined in GHC.Utils.Binary

Binary JoinPointHood # 
Instance details

Defined in GHC.Utils.Binary

Binary Boxity # 
Instance details

Defined in GHC.Types.Basic

Binary Fixity # 
Instance details

Defined in GHC.Hs.Basic

Binary FixityDirection # 
Instance details

Defined in GHC.Hs.Basic

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

Defined in GHC.Utils.Binary

Binary ModuleName # 
Instance details

Defined in GHC.Utils.Binary

Binary ForAllTyFlag # 
Instance details

Defined in GHC.Hs.Specificity

Binary Specificity # 
Instance details

Defined in GHC.Hs.Specificity

Binary PromotionFlag # 
Instance details

Defined in GHC.Types.Basic

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_ :: WriteBinHandle -> Day -> IO () #

put :: WriteBinHandle -> Day -> IO (Bin Day) #

get :: ReadBinHandle -> IO Day #

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_ :: WriteBinHandle -> () -> IO () #

put :: WriteBinHandle -> () -> IO (Bin ()) #

get :: ReadBinHandle -> IO () #

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_ :: WriteBinHandle -> Int -> IO () #

put :: WriteBinHandle -> Int -> IO (Bin Int) #

get :: ReadBinHandle -> IO Int #

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 v => Binary (IntMap v) # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: WriteBinHandle -> IntMap v -> IO () #

put :: WriteBinHandle -> IntMap v -> IO (Bin (IntMap v)) #

get :: ReadBinHandle -> IO (IntMap v) #

(Binary a, Ord a) => Binary (Set a) #

This instance doesn't rely on the determinism of the keys' Ord instance, so it works e.g. for Names too.

Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: WriteBinHandle -> Set a -> IO () #

put :: WriteBinHandle -> Set a -> IO (Bin (Set a)) #

get :: ReadBinHandle -> IO (Set a) #

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

Defined in GHC.Utils.Binary

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

Defined in GHC.Utils.Binary

Methods

put_ :: WriteBinHandle -> Ratio a -> IO () #

put :: WriteBinHandle -> Ratio a -> IO (Bin (Ratio a)) #

get :: ReadBinHandle -> IO (Ratio a) #

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

Defined in GHC.Utils.Binary

Methods

put_ :: WriteBinHandle -> Maybe a -> IO () #

put :: WriteBinHandle -> Maybe a -> IO (Bin (Maybe a)) #

get :: ReadBinHandle -> IO (Maybe a) #

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

Defined in GHC.Types.Annotations

Methods

put_ :: WriteBinHandle -> AnnTarget name -> IO () #

put :: WriteBinHandle -> AnnTarget name -> IO (Bin (AnnTarget name)) #

get :: ReadBinHandle -> IO (AnnTarget name) #

Binary (DefMethSpec IfaceType) # 
Instance details

Defined in GHC.Iface.Type

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

Defined in GHC.Unit.Types

Methods

put_ :: WriteBinHandle -> Definite unit -> IO () #

put :: WriteBinHandle -> Definite unit -> IO (Bin (Definite unit)) #

get :: ReadBinHandle -> IO (Definite unit) #

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

Defined in GHC.Utils.Binary

Enum a => Binary (EnumBinary a) # 
Instance details

Defined in GHC.Utils.Binary

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

Defined in GHC.Utils.Binary

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_ :: WriteBinHandle -> Maybe a -> IO () #

put :: WriteBinHandle -> Maybe a -> IO (Bin (Maybe a)) #

get :: ReadBinHandle -> IO (Maybe a) #

Binary a => Binary [a] # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: WriteBinHandle -> [a] -> IO () #

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

get :: ReadBinHandle -> IO [a] #

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

Defined in GHC.Utils.Binary

Methods

put_ :: WriteBinHandle -> Array a b -> IO () #

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

get :: ReadBinHandle -> IO (Array a b) #

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

Defined in GHC.Utils.Binary

Methods

put_ :: WriteBinHandle -> Either a b -> IO () #

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

get :: ReadBinHandle -> IO (Either a b) #

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

Defined in GHC.Utils.Binary.Typeable

Methods

put_ :: WriteBinHandle -> TypeRep a -> IO () #

put :: WriteBinHandle -> TypeRep a -> IO (Bin (TypeRep a)) #

get :: ReadBinHandle -> IO (TypeRep a) #

Binary (EnumSet a) #

Represents the EnumSet as a bit set.

Assumes that all elements are non-negative.

This is only efficient for values that are sufficiently small, for example in the lower hundreds.

Instance details

Defined in GHC.Data.EnumSet

Methods

put_ :: WriteBinHandle -> EnumSet a -> IO () #

put :: WriteBinHandle -> EnumSet a -> IO (Bin (EnumSet a)) #

get :: ReadBinHandle -> IO (EnumSet a) #

Binary a => Binary (WithHsDocIdentifiers a GhcRn) # 
Instance details

Defined in GHC.Hs.Doc

(Binary r, Binary b) => Binary (IfaceBindingX b r) # 
Instance details

Defined in GHC.Iface.Syntax

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

Defined in GHC.Types.Var

Methods

put_ :: WriteBinHandle -> VarBndr tv vis -> IO () #

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

get :: ReadBinHandle -> IO (VarBndr tv vis) #

Binary (Bin a) # 
Instance details

Defined in GHC.Utils.Binary

Methods

put_ :: WriteBinHandle -> Bin a -> IO () #

put :: WriteBinHandle -> Bin a -> IO (Bin (Bin a)) #

get :: ReadBinHandle -> IO (Bin a) #

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

Defined in GHC.Utils.Binary

Methods

put_ :: WriteBinHandle -> (a, b) -> IO () #

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

get :: ReadBinHandle -> IO (a, b) #

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

Defined in GHC.Utils.Binary

Methods

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

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

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

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

Defined in GHC.Utils.Binary

Methods

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

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

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

(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_ :: WriteBinHandle -> (a, b, c, d, e) -> IO () #

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

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

(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_ :: WriteBinHandle -> (a, b, c, d, e, f) -> IO () #

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

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

(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_ :: WriteBinHandle -> (a, b, c, d, e, f, g) -> IO () #

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

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

data ReadBinHandle #

A read-only handle that can be used to deserialise binary data from a buffer.

The buffer is an unboxed binary array.

data WriteBinHandle #

A write-only handle that can be used to serialise binary data into a buffer.

The buffer is an unboxed binary array.

type SymbolTable a = Array Int a #

Symbols that are read from disk. The SymbolTable index starts on '0'.

data BinData #

Constructors

BinData Int BinArray 

Instances

Instances details
NFData BinData # 
Instance details

Defined in GHC.Utils.Binary

Methods

rnf :: BinData -> () #

Binary BinData # 
Instance details

Defined in GHC.Utils.Binary

seekBinWriter :: forall {k} (a :: k). WriteBinHandle -> Bin a -> IO () #

seekBinReader :: forall {k} (a :: k). ReadBinHandle -> Bin a -> IO () #

SeekBin but without calling expandBin

seekBinReaderRel :: forall {k} (a :: k). ReadBinHandle -> RelBin a -> IO () #

tellBinReader :: forall {k} (a :: k). ReadBinHandle -> IO (Bin a) #

tellBinWriter :: forall {k} (a :: k). WriteBinHandle -> IO (Bin a) #

castBin :: forall {k1} {k2} (a :: k1) (b :: k2). Bin a -> Bin b #

withBinBuffer :: WriteBinHandle -> (ByteString -> IO a) -> IO a #

Get access to the underlying buffer.

freezeWriteHandle :: WriteBinHandle -> IO ReadBinHandle #

Freeze the given WriteBinHandle and turn it into an equivalent ReadBinHandle.

The current offset of the WriteBinHandle is maintained in the new ReadBinHandle.

shrinkBinBuffer :: WriteBinHandle -> IO ReadBinHandle #

Copy the BinBuffer to a new BinBuffer which is exactly the right size. This performs a copy of the underlying buffer. The buffer may be truncated if the offset is not at the end of the written output.

UserData is also discarded during the copy You should just use this when translating a Put handle into a Get handle.

foldGet :: Binary a => Word -> ReadBinHandle -> b -> (Word -> a -> b -> IO b) -> IO b #

foldGet' :: Binary a => Word -> ReadBinHandle -> b -> (Word -> a -> b -> IO b) -> IO b #

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

getAt :: Binary a => ReadBinHandle -> Bin a -> IO a #

putAtRel :: forall {k} (a :: k). WriteBinHandle -> Bin (RelBinPtr a) -> Bin a -> IO () #

forwardPut :: WriteBinHandle -> (b -> IO a) -> IO b -> IO (a, b) #

forwardPut put_A put_B outputs A after B but allows A to be read before B by using a forward reference.

forwardPut_ :: WriteBinHandle -> (b -> IO a) -> IO b -> IO () #

forwardGet :: ReadBinHandle -> IO a -> IO a #

Read a value stored using a forward reference

The forward reference is expected to be an absolute offset.

forwardPutRel :: WriteBinHandle -> (b -> IO a) -> IO b -> IO (a, b) #

forwardPutRel put_A put_B outputs A after B but allows A to be read before B by using a forward reference.

This forward reference is a relative offset that allows us to skip over the result of put_A.

forwardPutRel_ :: WriteBinHandle -> (b -> IO a) -> IO b -> IO () #

Like forwardGetRel, but discard the result.

forwardGetRel :: ReadBinHandle -> IO a -> IO a #

Read a value stored using a forward reference.

The forward reference is expected to be a relative offset.

For writing instances

putByteString :: WriteBinHandle -> ByteString -> IO () #

Put a ByteString without its length (can't be read back without knowing the length!)

getByteString :: ReadBinHandle -> Int -> IO ByteString #

Get a ByteString whose length is known

Variable length encodings

putSLEB128 :: (Integral a, Bits a) => WriteBinHandle -> a -> IO () #

Fixed length encoding

newtype FixedLengthEncoding a #

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

Constructors

FixedLengthEncoding 

Fields

Instances

Instances details
Show a => Show (FixedLengthEncoding a) # 
Instance details

Defined in GHC.Utils.Binary

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

Eq a => Eq (FixedLengthEncoding a) # 
Instance details

Defined in GHC.Utils.Binary

Ord a => Ord (FixedLengthEncoding a) # 
Instance details

Defined in GHC.Utils.Binary

Lazy Binary I/O

lazyPut :: Binary a => WriteBinHandle -> a -> IO () #

lazyPut' :: (WriteBinHandle -> a -> IO ()) -> WriteBinHandle -> a -> IO () #

lazyGetMaybe :: Binary a => ReadBinHandle -> IO (Maybe a) #

Deserialize a value serialized by lazyPutMaybe.

lazyPutMaybe :: Binary a => WriteBinHandle -> Maybe a -> IO () #

Serialize the constructor strictly but lazily serialize a value inside a Just.

This way we can check for the presence of a value without deserializing the value itself.

EnumBinary

newtype EnumBinary a #

Constructors

EnumBinary 

Fields

Instances

Instances details
Enum a => Binary (EnumBinary a) # 
Instance details

Defined in GHC.Utils.Binary

User data

data ReaderUserData #

UserData required to deserialise symbols for interface files.

See Note [Binary UserData]

data WriterUserData #

UserData required to serialise symbols for interface files.

See Note [Binary UserData]

newReadState #

Arguments

:: (ReadBinHandle -> IO Name)

how to deserialize Names

-> (ReadBinHandle -> IO FastString) 
-> ReaderUserData 

newWriteState #

Arguments

:: (WriteBinHandle -> Name -> IO ())

how to serialize non-binding Names

-> (WriteBinHandle -> Name -> IO ())

how to serialize binding Names

-> (WriteBinHandle -> FastString -> IO ()) 
-> WriterUserData 

addReaderToUserData :: Typeable a => BinaryReader a -> ReadBinHandle -> ReadBinHandle #

Add SomeBinaryReader as a known binary decoder. If a BinaryReader for the associated type already exists in ReaderUserData, it is overwritten.

addWriterToUserData :: Typeable a => BinaryWriter a -> WriteBinHandle -> WriteBinHandle #

Add SomeBinaryWriter as a known binary encoder. If a BinaryWriter for the associated type already exists in WriterUserData, it is overwritten.

findUserDataReader :: Typeable a => Proxy a -> ReadBinHandle -> BinaryReader a #

Find the BinaryReader for the Binary instance for the type identified by 'Proxy a'.

If no BinaryReader has been configured before, this function will panic.

findUserDataWriter :: Typeable a => Proxy a -> WriteBinHandle -> BinaryWriter a #

Find the BinaryWriter for the Binary instance for the type identified by 'Proxy a'.

If no BinaryWriter has been configured before, this function will panic.

Binary Readers & Writers

newtype BinaryReader s #

Constructors

BinaryReader 

Fields

Instances

Instances details
Functor BinaryReader # 
Instance details

Defined in GHC.Utils.Binary

Methods

fmap :: (a -> b) -> BinaryReader a -> BinaryReader b #

(<$) :: a -> BinaryReader b -> BinaryReader a #

newtype BinaryWriter s #

Constructors

BinaryWriter 

Fields

mkWriter :: (WriteBinHandle -> s -> IO ()) -> BinaryWriter s #

data SomeBinaryReader #

Existential for BinaryReader with a type witness.

data SomeBinaryWriter #

Existential for BinaryWriter with a type witness.

Tables

data ReaderTable a #

A ReaderTable describes how to deserialise a table from disk, and how to create a BinaryReader that looks up values in the deduplication table.

Constructors

ReaderTable 

Fields

newtype WriterTable #

A WriterTable is an interface any deduplication table can implement to describe how the table can be written to disk.

Constructors

WriterTable 

Fields

String table ("dictionary")

Generic deduplication table

data GenericSymbolTable (m :: Type -> Type) #

The GenericSymbolTable stores a mapping from already seen elements to an index. If an element wasn't seen before, it is added to the mapping together with a fresh index.

GenericSymbolTable is a variant of a BinSymbolTable that is polymorphic in the table implementation. As such it can be used with any container that implements the TrieMap type class.

While GenericSymbolTable is similar to the BinSymbolTable, it supports storing tree-like structures such as Type and IfaceType more efficiently.

Constructors

GenericSymbolTable 

Fields

  • gen_symtab_next :: !FastMutInt

    The next index to use.

  • gen_symtab_map :: !(IORef (m Int))

    Given a symbol, find the symbol and return its index.

  • gen_symtab_to_write :: !(IORef [Key m])

    Reversed list of values to write into the buffer. This is an optimisation, as it allows us to write out quickly all newly discovered values that are discovered when serialising 'Key m' to disk.

initGenericSymbolTable :: forall (m :: Type -> Type). TrieMap m => IO (GenericSymbolTable m) #

Initialise a GenericSymbolTable, initialising the index to '0'.

getGenericSymtab :: Binary a => SymbolTable a -> ReadBinHandle -> IO a #

Read a value from a SymbolTable.

putGenericSymTab :: forall (m :: Type -> Type). TrieMap m => GenericSymbolTable m -> WriteBinHandle -> Key m -> IO () #

Write an element 'Key m' to the given WriteBinHandle.

If the element was seen before, we simply write the index of that element to the WriteBinHandle. If we haven't seen it before, we add the element to the GenericSymbolTable, increment the index, and return this new index.

getGenericSymbolTable :: (ReadBinHandle -> IO a) -> ReadBinHandle -> IO (SymbolTable a) #

Read the elements of a GenericSymbolTable from disk into a SymbolTable.

putGenericSymbolTable :: forall (m :: Type -> Type). TrieMap m => GenericSymbolTable m -> (WriteBinHandle -> Key m -> IO ()) -> WriteBinHandle -> IO Int #

Serialise the GenericSymbolTable to disk.

Since GenericSymbolTable stores tree-like structures, such as IfaceType, serialising an element can add new elements to the mapping. Thus, putGenericSymbolTable first serialises all values, and then checks whether any new elements have been discovered. If so, repeat the loop.

Newtype wrappers

newtype BinSpan #

Constructors

BinSpan 

Instances

Instances details
Binary BinSpan # 
Instance details

Defined in GHC.Utils.Binary

newtype BinSrcSpan #

Constructors

BinSrcSpan 

Instances

Instances details
Binary BinSrcSpan # 
Instance details

Defined in GHC.Utils.Binary

newtype BinLocated a #

Constructors

BinLocated 

Fields

Instances

Instances details
Binary a => Binary (BinLocated a) # 
Instance details

Defined in GHC.Utils.Binary

Newtypes for types that have canonically more than one valid encoding

newtype BindingName #

Newtype to serialise binding names differently to non-binding Name. See Note [Binary UserData]

Constructors

BindingName 

Fields

Instances

Instances details
Eq BindingName # 
Instance details

Defined in GHC.Utils.Binary

data FullBinData #

FullBinData stores a slice to a BinArray.

It requires less memory than ReadBinHandle, and can be constructed from a ReadBinHandle via freezeBinHandle and turned back into a ReadBinHandle using thawBinHandle. Additionally, the byte array slice can be put into a WriteBinHandle without extra conversions via putFullBinData.

Constructors

FullBinData 

Fields

freezeBinHandle :: forall {k} (a :: k). ReadBinHandle -> Bin a -> IO FullBinData #

Freeze a ReadBinHandle and a start index into a FullBinData.

FullBinData stores a slice starting from the 'Bin a' location to the current offset of the ReadBinHandle.

thawBinHandle :: FullBinData -> IO ReadBinHandle #

Turn the FullBinData into a ReadBinHandle, setting the ReadBinHandle offset to the start of the FullBinData and restore the ReaderUserData that was obtained from freezeBinHandle.

FingerprintWithValue

data FingerprintWithValue a #

A wrapper which allows us to store a fingerprint and optionally the value which was used to create the fingerprint.

Instances

Instances details
Functor FingerprintWithValue # 
Instance details

Defined in GHC.Utils.Binary

NFData a => NFData (FingerprintWithValue a) # 
Instance details

Defined in GHC.Utils.Binary

Methods

rnf :: FingerprintWithValue a -> () #

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

Defined in GHC.Utils.Binary