Moduleghc-9.14.1GHC2021
GHC.Utils.Binary
- 26 types
- 1 class
- 78 values
- Packageghc-9.14.1
- Exports105
- LanguageGHC2021
- LicenceBSD-3-Clause
- SourceBinary.hs
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
RelBinrelBin_anchor :: !Bin aAbsolute position from where we read relBin_offset.
relBin_offset :: !RelBinPtr aRelative offset to relBin_anchor. The absolute position of the RelBin is
relBin_anchor + relBin_offset
Do not rely on instance sizes for general types, we use variable length encoding for many of them.
Methods
put_ :: WriteBinHandle -> a -> IO ()put :: WriteBinHandle -> a -> IO (Bin a)get :: ReadBinHandle -> IO a
Instances273Binary, …
Binary ByteStringDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary ShortByteStringDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary IsOrphanDefined in ghc-9.14.1 · GHC.CoreBinary StrictnessMarkDefined in ghc-9.14.1 · GHC.Core.DataConBinary CallerCcFilterDefined in ghc-9.14.1 · GHC.Core.Opt.CallerCC.TypesBinary NamePatternDefined in ghc-9.14.1 · GHC.Core.Opt.CallerCC.TypesBinary CoSelDefined in ghc-9.14.1 · GHC.Core.TyCo.RepBinary UnivCoProvenanceDefined in ghc-9.14.1 · GHC.Core.TyCo.RepBinary InjectivityDefined in ghc-9.14.1 · GHC.Core.TyConBinary PrimElemRepDefined in ghc-9.14.1 · GHC.Core.TyConBinary PrimRepDefined in ghc-9.14.1 · GHC.Core.TyConBinary TyConBndrVisDefined in ghc-9.14.1 · GHC.Core.TyConBinary FastStringDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary LexicalFastStringDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary NonDetFastStringDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary LanguageDefined in ghc-9.14.1 · GHC.Driver.FlagsBinary DocStructureItemDefined in ghc-9.14.1 · GHC.Hs.DocBinary DocsDefined in ghc-9.14.1 · GHC.Hs.DocBinary HsDocStringDefined in ghc-9.14.1 · GHC.Hs.DocStringBinary HsDocStringChunkDefined in ghc-9.14.1 · GHC.Hs.DocStringBinary HsDocStringDecoratorDefined in ghc-9.14.1 · GHC.Hs.DocStringBinary ExtensibleFieldsDefined in ghc-9.14.1 · GHC.Iface.Ext.FieldsBinary BindTypeDefined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary ContextInfoDefined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary DeclTypeDefined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary EntityInfoDefined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary EvBindDepsDefined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary EvVarSourceDefined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary HieFileDefined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary IETypeDefined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary NameEntityInfoDefined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary NodeAnnotationDefined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary NodeOriginDefined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary RecFieldContextDefined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary ScopeDefined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary TyVarScopeDefined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary IfaceCppOptionsDefined in ghc-9.14.1 · GHC.Iface.FlagsBinary IfaceDynFlagsDefined in ghc-9.14.1 · GHC.Iface.FlagsBinary IfaceExtensionDefined in ghc-9.14.1 · GHC.Iface.FlagsBinary IfaceGeneralFlagDefined in ghc-9.14.1 · GHC.Iface.FlagsBinary IfaceLanguageDefined in ghc-9.14.1 · GHC.Iface.FlagsBinary IfaceProfAutoDefined in ghc-9.14.1 · GHC.Iface.FlagsBinary IfaceDeclExtrasDefined in ghc-9.14.1 · GHC.Iface.RecompBinary IfaceIdExtrasDefined in ghc-9.14.1 · GHC.Iface.RecompBinary IfaceSelfRecompDefined in ghc-9.14.1 · GHC.Iface.Recomp.TypesBinary IfGuidanceDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceATDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceAltDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceAnnotationDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceAxBranchDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceBangDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceBooleanFormulaDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceClassOpDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceClsInstDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceCompleteMatchDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceConAltDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceConDeclDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceConDeclsDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceDeclDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceDefaultDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceExprDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceFamInstDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceFamTyConFlavDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceIdDetailsDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceImportDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceInfoItemDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceLFInfoDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceLetBndrDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceMaybeRhsDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceRuleDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceSrcBangDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceStringLiteralDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceTickishDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceTopBndrInfoDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceTyConParentDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceUnfoldingDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceWarningTxtDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfaceWarningsDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary ImpIfaceListDefined in ghc-9.14.1 · GHC.Iface.SyntaxBinary IfLclNameDefined in ghc-9.14.1 · GHC.Iface.TypeBinary IfaceAppArgsDefined in ghc-9.14.1 · GHC.Iface.TypeBinary IfaceAxiomRuleDefined in ghc-9.14.1 · GHC.Iface.TypeBinary IfaceBndrDefined in ghc-9.14.1 · GHC.Iface.TypeBinary IfaceCoercionDefined in ghc-9.14.1 · GHC.Iface.TypeBinary IfaceMCoercionDefined in ghc-9.14.1 · GHC.Iface.TypeBinary IfaceOneShotDefined in ghc-9.14.1 · GHC.Iface.TypeBinary IfaceTyConDefined in ghc-9.14.1 · GHC.Iface.TypeBinary IfaceTyConInfoDefined in ghc-9.14.1 · GHC.Iface.TypeBinary IfaceTyConSortDefined in ghc-9.14.1 · GHC.Iface.TypeBinary IfaceTyLitDefined in ghc-9.14.1 · GHC.Iface.TypeBinary IfaceTypeDefined in ghc-9.14.1 · GHC.Iface.TypeBinary IdentDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary AOpDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary JExprDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary JStatDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary JValDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary OpDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary UOpDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary TagInfoDefined in ghc-9.14.1 · GHC.Stg.EnforceEpt.TagSigBinary TagSigDefined in ghc-9.14.1 · GHC.Stg.EnforceEpt.TagSigBinary BlockDepsDefined in ghc-9.14.1 · GHC.StgToJS.ObjectBinary BlockInfoDefined in ghc-9.14.1 · GHC.StgToJS.ObjectBinary ExportedFunDefined in ghc-9.14.1 · GHC.StgToJS.ObjectBinary IndexEntryDefined in ghc-9.14.1 · GHC.StgToJS.ObjectBinary JSOptionsDefined in ghc-9.14.1 · GHC.StgToJS.ObjectBinary CILayoutDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary CIRegsDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary CIStaticDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary CITypeDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary ClosureInfoDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary ExpFunDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary ForeignJSRefDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary JSFFITypeDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary JSRepDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary StaticArgDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary StaticInfoDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary StaticLitDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary StaticUnboxedDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary StaticValDefined in ghc-9.14.1 · GHC.StgToJS.Object · orphanBinary AvailInfoDefined in ghc-9.14.1 · GHC.Types.AvailBinary DetOrdAvailsDefined in ghc-9.14.1 · GHC.Types.AvailBinary ActivationDefined in ghc-9.14.1 · GHC.Types.BasicBinary CbvMarkDefined in ghc-9.14.1 · GHC.Types.BasicBinary FunctionOrDataDefined in ghc-9.14.1 · GHC.Types.BasicBinary ImportLevelDefined in ghc-9.14.1 · GHC.Types.BasicBinary InlinePragmaDefined in ghc-9.14.1 · GHC.Types.BasicBinary InlineSpecDefined in ghc-9.14.1 · GHC.Types.BasicBinary LeftOrRightDefined in ghc-9.14.1 · GHC.Types.BasicBinary LevityDefined in ghc-9.14.1 · GHC.Types.BasicBinary OverlapFlagDefined in ghc-9.14.1 · GHC.Types.BasicBinary OverlapModeDefined in ghc-9.14.1 · GHC.Types.BasicBinary RecFlagDefined in ghc-9.14.1 · GHC.Types.BasicBinary RuleMatchInfoDefined in ghc-9.14.1 · GHC.Types.BasicBinary TupleSortDefined in ghc-9.14.1 · GHC.Types.BasicBinary TypeOrConstraintDefined in ghc-9.14.1 · GHC.Types.BasicBinary UnfoldingSourceDefined in ghc-9.14.1 · GHC.Types.BasicBinary CCFlavourDefined in ghc-9.14.1 · GHC.Types.CostCentreBinary CostCentreDefined in ghc-9.14.1 · GHC.Types.CostCentreBinary CostCentreIndexDefined in ghc-9.14.1 · GHC.Types.CostCentre.StateBinary CprDefined in ghc-9.14.1 · GHC.Types.CprBinary CprSigDefined in ghc-9.14.1 · GHC.Types.CprBinary CprTypeDefined in ghc-9.14.1 · GHC.Types.CprBinary CardDefined in ghc-9.14.1 · GHC.Types.DemandBinary DemandDefined in ghc-9.14.1 · GHC.Types.DemandBinary DivergenceDefined in ghc-9.14.1 · GHC.Types.DemandBinary DmdEnvDefined in ghc-9.14.1 · GHC.Types.DemandBinary DmdSigDefined in ghc-9.14.1 · GHC.Types.DemandBinary DmdTypeDefined in ghc-9.14.1 · GHC.Types.DemandBinary SubDemandDefined in ghc-9.14.1 · GHC.Types.DemandBinary DuplicateRecordFieldsDefined in ghc-9.14.1 · GHC.Types.FieldLabelBinary FieldSelectorsDefined in ghc-9.14.1 · GHC.Types.FieldLabelBinary CCallConvDefined in ghc-9.14.1 · GHC.Types.ForeignCallBinary CCallSpecDefined in ghc-9.14.1 · GHC.Types.ForeignCallBinary CCallTargetDefined in ghc-9.14.1 · GHC.Types.ForeignCallBinary CExportSpecDefined in ghc-9.14.1 · GHC.Types.ForeignCallBinary CTypeDefined in ghc-9.14.1 · GHC.Types.ForeignCallBinary ForeignCallDefined in ghc-9.14.1 · GHC.Types.ForeignCallBinary HeaderDefined in ghc-9.14.1 · GHC.Types.ForeignCallBinary SafetyDefined in ghc-9.14.1 · GHC.Types.ForeignCallBinary LitNumTypeDefined in ghc-9.14.1 · GHC.Types.LiteralBinary LiteralDefined in ghc-9.14.1 · GHC.Types.LiteralBinary Name => Binary FieldLabelDefined in ghc-9.14.1 · GHC.Types.FieldLabelWe need the
Binary Nameconstraint 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.Binary NameDefined in ghc-9.14.1 · GHC.Types.NameAssumes that the Name is a non-binding one. See putIfaceTopBndr and getIfaceTopBndr for serializing binding Names. See
UserDatafor the rationale for this distinction.Binary NameSpaceDefined in ghc-9.14.1 · GHC.Types.Name.OccurrenceBinary OccNameDefined in ghc-9.14.1 · GHC.Types.Name.OccurrenceBinary ImpDeclSpecDefined in ghc-9.14.1 · GHC.Types.Name.ReaderBinary PkgQualDefined in ghc-9.14.1 · GHC.Types.PkgQualBinary IfaceTrustInfoDefined in ghc-9.14.1 · GHC.Types.SafeHaskellBinary SaneDoubleDefined in ghc-9.14.1 · GHC.Types.SaneDoubleBinary HscSourceDefined in ghc-9.14.1 · GHC.Types.SourceFileBinary SourceTextDefined in ghc-9.14.1 · GHC.Types.SourceTextBinary UnhelpfulSpanReasonDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary FunTyFlagDefined in ghc-9.14.1 · GHC.Types.VarBinary DependenciesDefined in ghc-9.14.1 · GHC.Unit.Module.DepsBinary HomeModImportDefined in ghc-9.14.1 · GHC.Unit.Module.DepsBinary HomeModImportedAvailsDefined in ghc-9.14.1 · GHC.Unit.Module.DepsBinary IfaceImportLevelDefined in ghc-9.14.1 · GHC.Unit.Module.DepsBinary UsageDefined in ghc-9.14.1 · GHC.Unit.Module.DepsBinary IfaceAbiHashesDefined in ghc-9.14.1 · GHC.Unit.Module.ModIfaceBinary IfaceModInfoDefined in ghc-9.14.1 · GHC.Unit.Module.ModIfaceBinary IfaceSimplifiedCoreDefined in ghc-9.14.1 · GHC.Unit.Module.ModIfaceBinary IfaceTopEnvDefined in ghc-9.14.1 · GHC.Unit.Module.ModIfaceBinary ModIfaceDefined in ghc-9.14.1 · GHC.Unit.Module.ModIfaceBinary WarningCategoryDefined in ghc-9.14.1 · GHC.Unit.Module.WarningsBinary IfaceCLabelDefined in ghc-9.14.1 · GHC.Unit.Module.WholeCoreBindingsBinary IfaceCStubsDefined in ghc-9.14.1 · GHC.Unit.Module.WholeCoreBindingsBinary IfaceForeignDefined in ghc-9.14.1 · GHC.Unit.Module.WholeCoreBindingsBinary IfaceForeignFileDefined in ghc-9.14.1 · GHC.Unit.Module.WholeCoreBindingsBinary InstantiatedUnitDefined in ghc-9.14.1 · GHC.Unit.TypesBinary UnitDefined in ghc-9.14.1 · GHC.Unit.TypesBinary UnitIdDefined in ghc-9.14.1 · GHC.Unit.TypesBinary BinDataDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary BinSpanDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary BinSrcSpanDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary JoinPointHoodDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary BoxityDefined in ghc-9.14.1 · GHC.Types.Basic · orphanBinary FixityDefined in ghc-9.14.1 · GHC.Hs.Basic · orphanBinary FixityDirectionDefined in ghc-9.14.1 · GHC.Hs.Basic · orphanBinary RoleDefined in ghc-9.14.1 · GHC.Core.Coercion.Axiom · orphanBinary SrcStrictnessDefined in ghc-9.14.1 · GHC.Core.DataCon · orphanBinary SrcUnpackednessDefined in ghc-9.14.1 · GHC.Core.DataCon · orphanBinary IsBootInterfaceDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary ModuleNameDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary ForAllTyFlagDefined in ghc-9.14.1 · GHC.Hs.Specificity · orphanBinary SpecificityDefined in ghc-9.14.1 · GHC.Hs.Specificity · orphanBinary PromotionFlagDefined in ghc-9.14.1 · GHC.Types.Basic · orphanBinary SerializedDefined in ghc-9.14.1 · GHC.Utils.Binary.Typeable · orphanBinary IntegerDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary SomeTypeRepDefined in ghc-9.14.1 · GHC.Utils.Binary.Typeable · orphanBinary FingerprintDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary Int16Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary Int32Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary Int64Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary Int8Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary BoolDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary CharDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary IntDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary KindRepDefined in ghc-9.14.1 · GHC.Utils.Binary.Typeable · orphanBinary RuntimeRepDefined in ghc-9.14.1 · GHC.Utils.Binary.Typeable · orphanBinary TyConDefined in ghc-9.14.1 · GHC.Utils.Binary.Typeable · orphanBinary TypeLitSortDefined in ghc-9.14.1 · GHC.Utils.Binary.Typeable · orphanBinary VecCountDefined in ghc-9.14.1 · GHC.Utils.Binary.Typeable · orphanBinary VecElemDefined in ghc-9.14.1 · GHC.Utils.Binary.Typeable · orphanBinary Word16Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary Word32Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary Word64Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary Word8Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary DayDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary DiffTimeDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary UTCTimeDefined in ghc-9.14.1 · GHC.Utils.BinaryBinary ()Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary (HieAST TypeIndex)Defined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary (HieASTs TypeIndex)Defined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary (HieArgs TypeIndex)Defined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary (HieType TypeIndex)Defined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary (IdentifierDetails TypeIndex)Defined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary (NodeInfo TypeIndex)Defined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary (SourcedNodeInfo TypeIndex)Defined in ghc-9.14.1 · GHC.Iface.Ext.TypesBinary (DefMethSpec IfaceType)Defined in ghc-9.14.1 · GHC.Iface.TypeBinary (IfacePublic_ 'ModIfaceFinal)Defined in ghc-9.14.1 · GHC.Unit.Module.ModIfaceBinary (FixedLengthEncoding Word16)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary (FixedLengthEncoding Word32)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary (FixedLengthEncoding Word64)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary (FixedLengthEncoding Word8)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary a => Binary (Maybe a)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary a => Binary (GenModule a)Defined in ghc-9.14.1 · GHC.Unit.TypesBinary a => Binary (GenWithIsBoot a)Defined in ghc-9.14.1 · GHC.Unit.TypesBinary a => Binary (BinLocated a)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary a => Binary (FingerprintWithValue a)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary a => Binary (NonEmpty a)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary a => Binary (Maybe a)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary a => Binary (Ratio a)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary a => Binary [a]Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary name => Binary (AnnTarget name)Defined in ghc-9.14.1 · GHC.Types.AnnotationsBinary unit => Binary (Definite unit)Defined in ghc-9.14.1 · GHC.Unit.TypesBinary v => Binary (IntMap v)Defined in ghc-9.14.1 · GHC.Utils.BinaryEnum a => Binary (EnumBinary a)Defined in ghc-9.14.1 · GHC.Utils.Binary(Binary a, Ord a) => Binary (Set a)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary (EnumSet a)Defined in ghc-9.14.1 · GHC.Data.EnumSetRepresents 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.
Binary (Bin a)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary (RelBinPtr a)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary a => Binary (WithHsDocIdentifiers a GhcRn)Defined in ghc-9.14.1 · GHC.Hs.DocTypeable a => Binary (TypeRep a)Defined in ghc-9.14.1 · GHC.Utils.Binary.Typeable · orphan(Binary a, Binary b) => Binary (Either a b)Defined in ghc-9.14.1 · GHC.Utils.Binary(Binary a, Binary b) => Binary (a, b)Defined in ghc-9.14.1 · GHC.Utils.Binary(Binary r, Binary b) => Binary (IfaceBindingX b r)Defined in ghc-9.14.1 · GHC.Iface.Syntax(Binary tv, Binary vis) => Binary (VarBndr tv vis)Defined in ghc-9.14.1 · GHC.Types.Var(Ix a, Binary a, Binary b) => Binary (Array a b)Defined in ghc-9.14.1 · GHC.Utils.Binary(Binary a, Binary b, Binary c) => Binary (a, b, c)Defined in ghc-9.14.1 · GHC.Utils.Binary(Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)Defined in ghc-9.14.1 · GHC.Utils.Binary(Binary a, Binary b, Binary c, Binary d, Binary e) => Binary (a, b, c, d, e)Defined in ghc-9.14.1 · GHC.Utils.Binary(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f) => Binary (a, b, c, d, e, f)Defined in ghc-9.14.1 · GHC.Utils.Binary(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f, Binary g) => Binary (a, b, c, d, e, f, g)Defined in ghc-9.14.1 · GHC.Utils.Binary
A read-only handle that can be used to deserialise binary data from a buffer.
The buffer is an unboxed binary array.
A write-only handle that can be used to serialise binary data into a buffer.
The buffer is an unboxed binary array.
Symbols that are read from disk. The SymbolTable index starts on '0'.
A SymbolTable of FastStrings.
SeekBin but without calling expandBin
Get access to the underlying buffer.
Freeze the given WriteBinHandle and turn it into an equivalent ReadBinHandle.
The current offset of the WriteBinHandle is maintained in the new 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.
forwardPut put_A put_B outputs A after B but allows A to be read before B
by using a forward reference.
Read a value stored using a forward reference
The forward reference is expected to be an absolute offset.
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.
Like forwardGetRel, but discard the result.
Read a value stored using a forward reference.
The forward reference is expected to be a relative offset.
For writing instances
4 declarationsPut a ByteString without its length (can't be read back without knowing the length!)
Get a ByteString whose length is known
Variable length encodings
4 declarationsFixed length encoding
1 declarationEncode 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
Instances7Eq, Ord, Show, Binary, …
Eq a => Eq (FixedLengthEncoding a)Defined in ghc-9.14.1 · GHC.Utils.BinaryOrd a => Ord (FixedLengthEncoding a)Defined in ghc-9.14.1 · GHC.Utils.BinaryShow a => Show (FixedLengthEncoding a)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary (FixedLengthEncoding Word16)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary (FixedLengthEncoding Word32)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary (FixedLengthEncoding Word64)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary (FixedLengthEncoding Word8)Defined in ghc-9.14.1 · GHC.Utils.Binary
Lazy Binary I/O
6 declarationsDeserialize a value serialized by lazyPutMaybe.
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
1 declarationConstructors
Instances1Binary
Enum a => Binary (EnumBinary a)Defined in ghc-9.14.1 · GHC.Utils.Binary
User data
16 declarationsUserData required to deserialise symbols for interface files.
See Note [Binary UserData]
UserData required to serialise symbols for interface files.
See Note [Binary UserData]
newReadState :: (ReadBinHandle -> IO Name)how to deserialize Names
-> (ReadBinHandle -> IO FastString)-> ReaderUserData
newWriteState :: (WriteBinHandle -> Name -> IO ())how to serialize non-binding Names
-> (WriteBinHandle -> Name -> IO ())how to serialize binding Names
-> (WriteBinHandle -> FastString -> IO ())-> WriterUserData
Add SomeBinaryReader as a known binary decoder. If a BinaryReader for the associated type already exists in ReaderUserData, it is overwritten.
Add SomeBinaryWriter as a known binary encoder. If a BinaryWriter for the associated type already exists in WriterUserData, it is overwritten.
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.
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
8 declarationsConstructors
BinaryReadergetEntry :: ReadBinHandle -> IO s
Instances1Functor
Functor BinaryReaderDefined in ghc-9.14.1 · GHC.Utils.Binary
Constructors
BinaryWriterputEntry :: WriteBinHandle -> s -> IO ()
Existential for BinaryReader with a type witness.
Existential for BinaryWriter with a type witness.
Tables
2 declarationsA ReaderTable describes how to deserialise a table from disk, and how to create a BinaryReader that looks up values in the deduplication table.
Constructors
ReaderTablegetTable :: ReadBinHandle -> IO (SymbolTable a)Deserialise a list of elements into a SymbolTable.
mkReaderFromTable :: SymbolTable a -> BinaryReader aGiven the table from getTable, create a BinaryReader that reads values only from the SymbolTable.
A WriterTable is an interface any deduplication table can implement to describe how the table can be written to disk.
Constructors
WriterTableputTable :: WriteBinHandle -> IO IntSerialise a table to disk. Returns the number of written elements.
String table ("dictionary")
8 declarationsConstructors
FSTablefs_tab_next :: !FastMutIntfs_tab_map :: !IORef (UniqFM FastString (Int, FastString))
Generic deduplication table
6 declarationsThe 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
GenericSymbolTablegen_symtab_next :: !FastMutIntThe 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.
Initialise a GenericSymbolTable, initialising the index to '0'.
Read a value from a SymbolTable.
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.
Read the elements of a GenericSymbolTable from disk into a SymbolTable.
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
3 declarationsConstructors
Constructors
Instances1Binary
Binary BinSrcSpanDefined in ghc-9.14.1 · GHC.Utils.Binary
Constructors
Instances1Binary
Binary a => Binary (BinLocated a)Defined in ghc-9.14.1 · GHC.Utils.Binary
Newtypes for types that have canonically more than one valid encoding
8 declarationsNewtype to serialise binding names differently to non-binding Name. See Note [Binary UserData]
Constructors
Instances1Eq
Eq BindingNameDefined in ghc-9.14.1 · GHC.Utils.Binary
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
FullBinDatafbd_readerUserData :: ReaderUserDataReaderUserData that can be used to resume reading.
fbd_off_s :: !Intstart offset
fbd_off_e :: !Intend offset
fbd_size :: !Inttotal buffer size
fbd_buffer :: !BinArray
Instances2Eq, Ord
Eq FullBinDataDefined in ghc-9.14.1 · GHC.Utils.BinaryOrd FullBinDataDefined in ghc-9.14.1 · GHC.Utils.Binary
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.
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.
Write the FullBinData slice into the WriteBinHandle.
FingerprintWithValue
1 declarationA wrapper which allows us to store a fingerprint and optionally the value which was used to create the fingerprint.
Constructors
Instances3Functor, NFData, Binary
Functor FingerprintWithValueDefined in ghc-9.14.1 · GHC.Utils.BinaryNFData a => NFData (FingerprintWithValue a)Defined in ghc-9.14.1 · GHC.Utils.BinaryBinary a => Binary (FingerprintWithValue a)Defined in ghc-9.14.1 · GHC.Utils.Binary