ghc-9.10.0.20240426: The GHC API
Safe HaskellNone
LanguageGHC2021

GHC.Utils.Binary

Synopsis

Documentation

data Bin (a :: k) Source #

Instances

Instances details
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 #

Bounded (Bin a) Source # 
Instance details

Defined in GHC.Utils.Binary

Methods

minBound :: Bin a #

maxBound :: Bin a #

Show (Bin a) Source # 
Instance details

Defined in GHC.Utils.Binary

Methods

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

show :: Bin a -> String #

showList :: [Bin a] -> ShowS #

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

Defined in GHC.Utils.Binary

Binary IsOrphan Source # 
Instance details

Defined in GHC.Core

Binary StrictnessMark Source # 
Instance details

Defined in GHC.Core.DataCon

Binary CallerCcFilter Source # 
Instance details

Defined in GHC.Core.Opt.CallerCC.Types

Binary NamePattern Source # 
Instance details

Defined in GHC.Core.Opt.CallerCC.Types

Binary CoSel Source # 
Instance details

Defined in GHC.Core.TyCo.Rep

Binary Injectivity Source # 
Instance details

Defined in GHC.Core.TyCon

Binary PrimElemRep Source # 
Instance details

Defined in GHC.Core.TyCon

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

Defined in GHC.Driver.Flags

Binary DocStructureItem Source # 
Instance details

Defined in GHC.Hs.Doc

Binary Docs Source # 
Instance details

Defined in GHC.Hs.Doc

Binary HsDocString Source # 
Instance details

Defined in GHC.Hs.DocString

Binary HsDocStringChunk Source # 
Instance details

Defined in GHC.Hs.DocString

Binary HsDocStringDecorator Source # 
Instance details

Defined in GHC.Hs.DocString

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

Defined in GHC.Iface.Syntax

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

Defined in GHC.Iface.Syntax

Binary IfaceLetBndr Source # 
Instance details

Defined in GHC.Iface.Syntax

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

Defined in GHC.Iface.Syntax

Binary IfaceTickish Source # 
Instance details

Defined in GHC.Iface.Syntax

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

Defined in GHC.Iface.Syntax

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

Defined in GHC.StgToJS.Object

Binary AOp Source # 
Instance details

Defined in GHC.StgToJS.Object

Methods

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

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

get :: BinHandle -> IO AOp Source #

Binary JExpr Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary JStat Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary JVal Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary Op Source # 
Instance details

Defined in GHC.StgToJS.Object

Methods

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

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

get :: BinHandle -> IO Op Source #

Binary UOp Source # 
Instance details

Defined in GHC.StgToJS.Object

Methods

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

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

get :: BinHandle -> IO UOp Source #

Binary TagInfo Source # 
Instance details

Defined in GHC.Stg.InferTags.TagSig

Binary TagSig Source # 
Instance details

Defined in GHC.Stg.InferTags.TagSig

Binary BlockDeps Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary BlockInfo Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary ExportedFun Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary IndexEntry Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary JSOptions Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary CILayout Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary CIRegs Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary CIStatic Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary CIType Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary ClosureInfo Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary ExpFun Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary ForeignJSRef Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary JSFFIType Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary JSRep Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary StaticArg Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary StaticInfo Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary StaticLit Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary StaticUnboxed Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary StaticVal Source # 
Instance details

Defined in GHC.StgToJS.Object

Binary AvailInfo Source # 
Instance details

Defined in GHC.Types.Avail

Binary Activation Source # 
Instance details

Defined in GHC.Types.Basic

Binary CbvMark 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 Levity 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 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 UnfoldingSource 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 DmdEnv Source # 
Instance details

Defined in GHC.Types.Demand

Binary DmdSig Source # 
Instance details

Defined in GHC.Types.Demand

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

Defined in GHC.Types.SaneDouble

Binary HscSource Source # 
Instance details

Defined in GHC.Types.SourceFile

Binary SourceText Source # 
Instance details

Defined in GHC.Types.SourceText

Binary UnhelpfulSpanReason Source # 
Instance details

Defined in GHC.Utils.Binary

Binary ForAllTyFlag Source # 
Instance details

Defined in GHC.Types.Var

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

Defined in GHC.Unit.Module.Warnings

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

Defined in GHC.Utils.Binary

Binary BinSrcSpan Source # 
Instance details

Defined in GHC.Utils.Binary

Binary JoinPointHood Source # 
Instance details

Defined in GHC.Utils.Binary

Binary Boxity Source # 
Instance details

Defined in GHC.Types.Basic

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

Defined in GHC.Unit.Types

Binary ModuleName Source # 
Instance details

Defined in GHC.Utils.Binary

Binary PromotionFlag Source # 
Instance details

Defined in GHC.Types.Basic

Binary Serialized Source # 
Instance details

Defined in GHC.Utils.Binary.Typeable

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

Defined in GHC.Utils.Binary

Methods

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

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

get :: BinHandle -> IO (IntMap v) Source #

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

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_ :: BinHandle -> Set a -> IO () Source #

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

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

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

Defined in GHC.Utils.Binary

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

Defined in GHC.Utils.Binary

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 (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 (EnumSet a) Source #

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_ :: BinHandle -> EnumSet a -> IO () Source #

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

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

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

Defined in GHC.Hs.Doc

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

Defined in GHC.Iface.Syntax

(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 #

(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 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 #

(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 :: forall {k} (a :: k). BinHandle -> Bin a -> IO () Source #

tellBin :: forall {k} (a :: k). BinHandle -> IO (Bin a) Source #

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

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

Get access to the underlying buffer.

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

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

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

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

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

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

forwardPut_ :: BinHandle -> (b -> IO a) -> IO b -> IO () Source #

forwardGet :: BinHandle -> IO a -> IO a Source #

Read a value stored using a forward reference

For writing instances

putByteString :: BinHandle -> ByteString -> IO () Source #

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

getByteString :: BinHandle -> Int -> IO ByteString Source #

Get a ByteString whose length is known

Variable length encodings

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

Fixed length encoding

newtype FixedLengthEncoding a Source #

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
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

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

Defined in GHC.Utils.Binary

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

Defined in GHC.Utils.Binary

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

Defined in GHC.Utils.Binary

Lazy Binary I/O

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

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

Deserialize a value serialized by lazyPutMaybe.

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

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.

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 

String table ("dictionary")

Newtype wrappers

newtype BinSpan Source #

Constructors

BinSpan 

Instances

Instances details
Binary BinSpan Source # 
Instance details

Defined in GHC.Utils.Binary

newtype BinSrcSpan Source #

Constructors

BinSrcSpan 

Instances

Instances details
Binary BinSrcSpan Source # 
Instance details

Defined in GHC.Utils.Binary

newtype BinLocated a Source #

Constructors

BinLocated 

Fields

Instances

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

Defined in GHC.Utils.Binary