Binary

ghc-8.10.7: The GHC API

Safe Haskell | None
Language | Haskell2010

Binary

Contents

- For writing instances
- Variable length encodings
- Lazy Binary I/O
- User data

Synopsis

- data Bin a
- class Binary a where
  - put_ :: BinHandle -> a -> IO ()
  - put :: BinHandle -> a -> IO (Bin a)
  - get :: BinHandle -> IO a
- data BinHandle
- type SymbolTable = Array Int Name
- type Dictionary = Array Int FastString
- openBinMem :: Int -> IO BinHandle
- seekBin :: BinHandle -> Bin a -> IO ()
- seekBy :: BinHandle -> Int -> IO ()
- tellBin :: BinHandle -> IO (Bin a)
- castBin :: Bin a -> Bin b
- isEOFBin :: BinHandle -> IO Bool
- withBinBuffer :: BinHandle -> (ByteString -> IO a) -> IO a
- writeBinMem :: BinHandle -> FilePath -> IO ()
- readBinMem :: FilePath -> IO BinHandle
- putAt :: Binary a => BinHandle -> Bin a -> a -> IO ()
- getAt :: Binary a => BinHandle -> Bin a -> IO a
- putByte :: BinHandle -> Word8 -> IO ()
- getByte :: BinHandle -> IO Word8
- putULEB128 :: forall a. (Integral a, FiniteBits a) => BinHandle -> a -> IO ()
- getULEB128 :: forall a. (Integral a, FiniteBits a) => BinHandle -> IO a
- putSLEB128 :: forall a. (Integral a, Bits a) => BinHandle -> a -> IO ()
- getSLEB128 :: forall a. (Show a, Integral a, FiniteBits a) => BinHandle -> IO a
- lazyGet :: Binary a => BinHandle -> IO a
- lazyPut :: Binary a => BinHandle -> a -> IO ()
- data UserData = UserData {
  - ud_get_name :: BinHandle -> IO Name
  - ud_get_fs :: BinHandle -> IO FastString
  - ud_put_nonbinding_name :: BinHandle -> Name -> IO ()
  - ud_put_binding_name :: BinHandle -> Name -> IO ()
  - ud_put_fs :: BinHandle -> FastString -> IO ()
  }
- getUserData :: BinHandle -> UserData
- setUserData :: BinHandle -> UserData -> BinHandle
- newReadState :: (BinHandle -> IO Name) -> (BinHandle -> IO FastString) -> UserData
- newWriteState :: (BinHandle -> Name -> IO ()) -> (BinHandle -> Name -> IO ()) -> (BinHandle -> FastString -> IO ()) -> UserData
- putDictionary :: BinHandle -> Int -> UniqFM (Int, FastString) -> IO ()
- getDictionary :: BinHandle -> IO Dictionary
- putFS :: BinHandle -> FastString -> IO ()

# Documentation

data Bin a Source #

#### Instances

Instances details

Bounded (Bin a) # |
Instance details Defined in Binary Methods minBound :: Bin a Source # maxBound :: Bin a Source #
Eq (Bin a) # |
Instance details Defined in Binary Methods (==) :: Bin a -> Bin a -> Bool # (/=) :: Bin a -> Bin a -> Bool #
Ord (Bin a) # |
Instance details Defined in 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 #
Show (Bin a) # |
Instance details Defined in Binary Methods showsPrec :: Int -> Bin a -> ShowS Source # show :: Bin a -> String Source # showList :: [Bin a] -> ShowS Source #
Binary (Bin a) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Bin a -> IO () Source # put :: BinHandle -> Bin a -> IO (Bin (Bin a)) Source # get :: BinHandle -> IO (Bin a) Source #

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 Bool # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Bool -> IO () Source # put :: BinHandle -> Bool -> IO (Bin Bool) Source # get :: BinHandle -> IO Bool Source #
Binary Char # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Char -> IO () Source # put :: BinHandle -> Char -> IO (Bin Char) Source # get :: BinHandle -> IO Char Source #
Binary Int # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Int -> IO () Source # put :: BinHandle -> Int -> IO (Bin Int) Source # get :: BinHandle -> IO Int Source #
Binary Int8 # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Int8 -> IO () Source # put :: BinHandle -> Int8 -> IO (Bin Int8) Source # get :: BinHandle -> IO Int8 Source #
Binary Int16 # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Int16 -> IO () Source # put :: BinHandle -> Int16 -> IO (Bin Int16) Source # get :: BinHandle -> IO Int16 Source #
Binary Int32 # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Int32 -> IO () Source # put :: BinHandle -> Int32 -> IO (Bin Int32) Source # get :: BinHandle -> IO Int32 Source #
Binary Int64 # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Int64 -> IO () Source # put :: BinHandle -> Int64 -> IO (Bin Int64) Source # get :: BinHandle -> IO Int64 Source #
Binary Integer # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Integer -> IO () Source # put :: BinHandle -> Integer -> IO (Bin Integer) Source # get :: BinHandle -> IO Integer Source #
Binary Word8 # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Word8 -> IO () Source # put :: BinHandle -> Word8 -> IO (Bin Word8) Source # get :: BinHandle -> IO Word8 Source #
Binary Word16 # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Word16 -> IO () Source # put :: BinHandle -> Word16 -> IO (Bin Word16) Source # get :: BinHandle -> IO Word16 Source #
Binary Word32 # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Word32 -> IO () Source # put :: BinHandle -> Word32 -> IO (Bin Word32) Source # get :: BinHandle -> IO Word32 Source #
Binary Word64 # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Word64 -> IO () Source # put :: BinHandle -> Word64 -> IO (Bin Word64) Source # get :: BinHandle -> IO Word64 Source #
Binary RuntimeRep # |
Instance details Defined in Binary Methods put_ :: BinHandle -> RuntimeRep -> IO () Source # put :: BinHandle -> RuntimeRep -> IO (Bin RuntimeRep) Source # get :: BinHandle -> IO RuntimeRep Source #
Binary VecCount # |
Instance details Defined in Binary Methods put_ :: BinHandle -> VecCount -> IO () Source # put :: BinHandle -> VecCount -> IO (Bin VecCount) Source # get :: BinHandle -> IO VecCount Source #
Binary VecElem # |
Instance details Defined in Binary Methods put_ :: BinHandle -> VecElem -> IO () Source # put :: BinHandle -> VecElem -> IO (Bin VecElem) Source # get :: BinHandle -> IO VecElem Source #
Binary SomeTypeRep # |
Instance details Defined in Binary Methods put_ :: BinHandle -> SomeTypeRep -> IO () Source # put :: BinHandle -> SomeTypeRep -> IO (Bin SomeTypeRep) Source # get :: BinHandle -> IO SomeTypeRep Source #
Binary () # |
Instance details Defined in Binary Methods put_ :: BinHandle -> () -> IO () Source # put :: BinHandle -> () -> IO (Bin ()) Source # get :: BinHandle -> IO () Source #
Binary TyCon # |
Instance details Defined in Binary Methods put_ :: BinHandle -> TyCon -> IO () Source # put :: BinHandle -> TyCon -> IO (Bin TyCon) Source # get :: BinHandle -> IO TyCon Source #
Binary KindRep # |
Instance details Defined in Binary Methods put_ :: BinHandle -> KindRep -> IO () Source # put :: BinHandle -> KindRep -> IO (Bin KindRep) Source # get :: BinHandle -> IO KindRep Source #
Binary TypeLitSort # |
Instance details Defined in Binary Methods put_ :: BinHandle -> TypeLitSort -> IO () Source # put :: BinHandle -> TypeLitSort -> IO (Bin TypeLitSort) Source # get :: BinHandle -> IO TypeLitSort Source #
Binary Fingerprint # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Fingerprint -> IO () Source # put :: BinHandle -> Fingerprint -> IO (Bin Fingerprint) Source # get :: BinHandle -> IO Fingerprint Source #
Binary ByteString # |
Instance details Defined in Binary Methods put_ :: BinHandle -> ByteString -> IO () Source # put :: BinHandle -> ByteString -> IO (Bin ByteString) Source # get :: BinHandle -> IO ByteString Source #
Binary Serialized # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Serialized -> IO () Source # put :: BinHandle -> Serialized -> IO (Bin Serialized) Source # get :: BinHandle -> IO Serialized Source #
Binary UTCTime # |
Instance details Defined in Binary Methods put_ :: BinHandle -> UTCTime -> IO () Source # put :: BinHandle -> UTCTime -> IO (Bin UTCTime) Source # get :: BinHandle -> IO UTCTime Source #
Binary DiffTime # |
Instance details Defined in Binary Methods put_ :: BinHandle -> DiffTime -> IO () Source # put :: BinHandle -> DiffTime -> IO (Bin DiffTime) Source # get :: BinHandle -> IO DiffTime Source #
Binary Day # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Day -> IO () Source # put :: BinHandle -> Day -> IO (Bin Day) Source # get :: BinHandle -> IO Day Source #
Binary Name # | Assumes that the `Name` is a non-binding one. See `putIfaceTopBndr` and `getIfaceTopBndr` for serializing binding `Name`s. See `UserData` for the rationale for this distinction.
Instance details Defined in Name Methods put_ :: BinHandle -> Name -> IO () Source # put :: BinHandle -> Name -> IO (Bin Name) Source # get :: BinHandle -> IO Name Source #
Binary OccName # |
Instance details Defined in OccName Methods put_ :: BinHandle -> OccName -> IO () Source # put :: BinHandle -> OccName -> IO (Bin OccName) Source # get :: BinHandle -> IO OccName Source #
Binary FastString # |
Instance details Defined in Binary Methods put_ :: BinHandle -> FastString -> IO () Source # put :: BinHandle -> FastString -> IO (Bin FastString) Source # get :: BinHandle -> IO FastString Source #
Binary ComponentId # |
Instance details Defined in Module Methods put_ :: BinHandle -> ComponentId -> IO () Source # put :: BinHandle -> ComponentId -> IO (Bin ComponentId) Source # get :: BinHandle -> IO ComponentId Source #
Binary InstalledUnitId # |
Instance details Defined in Module Methods put_ :: BinHandle -> InstalledUnitId -> IO () Source # put :: BinHandle -> InstalledUnitId -> IO (Bin InstalledUnitId) Source # get :: BinHandle -> IO InstalledUnitId Source #
Binary UnitId # |
Instance details Defined in Module Methods put_ :: BinHandle -> UnitId -> IO () Source # put :: BinHandle -> UnitId -> IO (Bin UnitId) Source # get :: BinHandle -> IO UnitId Source #
Binary ModuleName # |
Instance details Defined in Module Methods put_ :: BinHandle -> ModuleName -> IO () Source # put :: BinHandle -> ModuleName -> IO (Bin ModuleName) Source # get :: BinHandle -> IO ModuleName Source #
Binary Module # |
Instance details Defined in Module Methods put_ :: BinHandle -> Module -> IO () Source # put :: BinHandle -> Module -> IO (Bin Module) Source # get :: BinHandle -> IO Module Source #
Binary SrcSpan # |
Instance details Defined in Binary Methods put_ :: BinHandle -> SrcSpan -> IO () Source # put :: BinHandle -> SrcSpan -> IO (Bin SrcSpan) Source # get :: BinHandle -> IO SrcSpan Source #
Binary RealSrcSpan # |
Instance details Defined in Binary Methods put_ :: BinHandle -> RealSrcSpan -> IO () Source # put :: BinHandle -> RealSrcSpan -> IO (Bin RealSrcSpan) Source # get :: BinHandle -> IO RealSrcSpan Source #
Binary InlineSpec # |
Instance details Defined in Binary Methods put_ :: BinHandle -> InlineSpec -> IO () Source # put :: BinHandle -> InlineSpec -> IO (Bin InlineSpec) Source # get :: BinHandle -> IO InlineSpec Source #
Binary InlinePragma # |
Instance details Defined in Binary Methods put_ :: BinHandle -> InlinePragma -> IO () Source # put :: BinHandle -> InlinePragma -> IO (Bin InlinePragma) Source # get :: BinHandle -> IO InlinePragma Source #
Binary RuleMatchInfo # |
Instance details Defined in Binary Methods put_ :: BinHandle -> RuleMatchInfo -> IO () Source # put :: BinHandle -> RuleMatchInfo -> IO (Bin RuleMatchInfo) Source # get :: BinHandle -> IO RuleMatchInfo Source #
Binary Activation # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Activation -> IO () Source # put :: BinHandle -> Activation -> IO (Bin Activation) Source # get :: BinHandle -> IO Activation Source #
Binary SourceText # |
Instance details Defined in Binary Methods put_ :: BinHandle -> SourceText -> IO () Source # put :: BinHandle -> SourceText -> IO (Bin SourceText) Source # get :: BinHandle -> IO SourceText Source #
Binary TupleSort # |
Instance details Defined in Binary Methods put_ :: BinHandle -> TupleSort -> IO () Source # put :: BinHandle -> TupleSort -> IO (Bin TupleSort) Source # get :: BinHandle -> IO TupleSort Source #
Binary OverlapMode # |
Instance details Defined in Binary Methods put_ :: BinHandle -> OverlapMode -> IO () Source # put :: BinHandle -> OverlapMode -> IO (Bin OverlapMode) Source # get :: BinHandle -> IO OverlapMode Source #
Binary OverlapFlag # |
Instance details Defined in Binary Methods put_ :: BinHandle -> OverlapFlag -> IO () Source # put :: BinHandle -> OverlapFlag -> IO (Bin OverlapFlag) Source # get :: BinHandle -> IO OverlapFlag Source #
Binary RecFlag # |
Instance details Defined in Binary Methods put_ :: BinHandle -> RecFlag -> IO () Source # put :: BinHandle -> RecFlag -> IO (Bin RecFlag) Source # get :: BinHandle -> IO RecFlag Source #
Binary FixityDirection # |
Instance details Defined in Binary Methods put_ :: BinHandle -> FixityDirection -> IO () Source # put :: BinHandle -> FixityDirection -> IO (Bin FixityDirection) Source # get :: BinHandle -> IO FixityDirection Source #
Binary Fixity # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Fixity -> IO () Source # put :: BinHandle -> Fixity -> IO (Bin Fixity) Source # get :: BinHandle -> IO Fixity Source #
Binary WarningTxt # |
Instance details Defined in Binary Methods put_ :: BinHandle -> WarningTxt -> IO () Source # put :: BinHandle -> WarningTxt -> IO (Bin WarningTxt) Source # get :: BinHandle -> IO WarningTxt Source #
Binary StringLiteral # |
Instance details Defined in Binary Methods put_ :: BinHandle -> StringLiteral -> IO () Source # put :: BinHandle -> StringLiteral -> IO (Bin StringLiteral) Source # get :: BinHandle -> IO StringLiteral Source #
Binary FunctionOrData # |
Instance details Defined in Binary Methods put_ :: BinHandle -> FunctionOrData -> IO () Source # put :: BinHandle -> FunctionOrData -> IO (Bin FunctionOrData) Source # get :: BinHandle -> IO FunctionOrData Source #
Binary PromotionFlag # |
Instance details Defined in Binary Methods put_ :: BinHandle -> PromotionFlag -> IO () Source # put :: BinHandle -> PromotionFlag -> IO (Bin PromotionFlag) Source # get :: BinHandle -> IO PromotionFlag Source #
Binary LeftOrRight # |
Instance details Defined in Binary Methods put_ :: BinHandle -> LeftOrRight -> IO () Source # put :: BinHandle -> LeftOrRight -> IO (Bin LeftOrRight) Source # get :: BinHandle -> IO LeftOrRight Source #
Binary PrimRep # |
Instance details Defined in TyCon Methods put_ :: BinHandle -> PrimRep -> IO () Source # put :: BinHandle -> PrimRep -> IO (Bin PrimRep) Source # get :: BinHandle -> IO PrimRep Source #
Binary DefUnitId # |
Instance details Defined in Module Methods put_ :: BinHandle -> DefUnitId -> IO () Source # put :: BinHandle -> DefUnitId -> IO (Bin DefUnitId) Source # get :: BinHandle -> IO DefUnitId Source #
Binary IndefUnitId # |
Instance details Defined in Module Methods put_ :: BinHandle -> IndefUnitId -> IO () Source # put :: BinHandle -> IndefUnitId -> IO (Bin IndefUnitId) Source # get :: BinHandle -> IO IndefUnitId Source #
Binary CType # |
Instance details Defined in ForeignCall Methods put_ :: BinHandle -> CType -> IO () Source # put :: BinHandle -> CType -> IO (Bin CType) Source # get :: BinHandle -> IO CType Source #
Binary Header # |
Instance details Defined in ForeignCall Methods put_ :: BinHandle -> Header -> IO () Source # put :: BinHandle -> Header -> IO (Bin Header) Source # get :: BinHandle -> IO Header Source #
Binary CCallConv # |
Instance details Defined in ForeignCall Methods put_ :: BinHandle -> CCallConv -> IO () Source # put :: BinHandle -> CCallConv -> IO (Bin CCallConv) Source # get :: BinHandle -> IO CCallConv Source #
Binary CCallTarget # |
Instance details Defined in ForeignCall Methods put_ :: BinHandle -> CCallTarget -> IO () Source # put :: BinHandle -> CCallTarget -> IO (Bin CCallTarget) Source # get :: BinHandle -> IO CCallTarget Source #
Binary CCallSpec # |
Instance details Defined in ForeignCall Methods put_ :: BinHandle -> CCallSpec -> IO () Source # put :: BinHandle -> CCallSpec -> IO (Bin CCallSpec) Source # get :: BinHandle -> IO CCallSpec Source #
Binary CExportSpec # |
Instance details Defined in ForeignCall Methods put_ :: BinHandle -> CExportSpec -> IO () Source # put :: BinHandle -> CExportSpec -> IO (Bin CExportSpec) Source # get :: BinHandle -> IO CExportSpec Source #
Binary Safety # |
Instance details Defined in ForeignCall Methods put_ :: BinHandle -> Safety -> IO () Source # put :: BinHandle -> Safety -> IO (Bin Safety) Source # get :: BinHandle -> IO Safety Source #
Binary ForeignCall # |
Instance details Defined in ForeignCall Methods put_ :: BinHandle -> ForeignCall -> IO () Source # put :: BinHandle -> ForeignCall -> IO (Bin ForeignCall) Source # get :: BinHandle -> IO ForeignCall Source #
Binary CostCentreIndex # |
Instance details Defined in CostCentreState Methods put_ :: BinHandle -> CostCentreIndex -> IO () Source # put :: BinHandle -> CostCentreIndex -> IO (Bin CostCentreIndex) Source # get :: BinHandle -> IO CostCentreIndex Source #
Binary HscSource # |
Instance details Defined in DriverPhases Methods put_ :: BinHandle -> HscSource -> IO () Source # put :: BinHandle -> HscSource -> IO (Bin HscSource) Source # get :: BinHandle -> IO HscSource Source #
Binary NameSpace # |
Instance details Defined in OccName Methods put_ :: BinHandle -> NameSpace -> IO () Source # put :: BinHandle -> NameSpace -> IO (Bin NameSpace) Source # get :: BinHandle -> IO NameSpace Source #
Binary AnonArgFlag # |
Instance details Defined in Var Methods put_ :: BinHandle -> AnonArgFlag -> IO () Source # put :: BinHandle -> AnonArgFlag -> IO (Bin AnonArgFlag) Source # get :: BinHandle -> IO AnonArgFlag Source #
Binary ArgFlag # |
Instance details Defined in Var Methods put_ :: BinHandle -> ArgFlag -> IO () Source # put :: BinHandle -> ArgFlag -> IO (Bin ArgFlag) Source # get :: BinHandle -> IO ArgFlag Source #
Binary ArgDocMap # |
Instance details Defined in GHC.Hs.Doc Methods put_ :: BinHandle -> ArgDocMap -> IO () Source # put :: BinHandle -> ArgDocMap -> IO (Bin ArgDocMap) Source # get :: BinHandle -> IO ArgDocMap Source #
Binary DeclDocMap # |
Instance details Defined in GHC.Hs.Doc Methods put_ :: BinHandle -> DeclDocMap -> IO () Source # put :: BinHandle -> DeclDocMap -> IO (Bin DeclDocMap) Source # get :: BinHandle -> IO DeclDocMap Source #
Binary HsDocString # |
Instance details Defined in GHC.Hs.Doc Methods put_ :: BinHandle -> HsDocString -> IO () Source # put :: BinHandle -> HsDocString -> IO (Bin HsDocString) Source # get :: BinHandle -> IO HsDocString Source #
Binary AvailInfo # |
Instance details Defined in Avail Methods put_ :: BinHandle -> AvailInfo -> IO () Source # put :: BinHandle -> AvailInfo -> IO (Bin AvailInfo) Source # get :: BinHandle -> IO AvailInfo Source #
Binary IfaceBndr # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceBndr -> IO () Source # put :: BinHandle -> IfaceBndr -> IO (Bin IfaceBndr) Source # get :: BinHandle -> IO IfaceBndr Source #
Binary IfaceCoercion # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceCoercion -> IO () Source # put :: BinHandle -> IfaceCoercion -> IO (Bin IfaceCoercion) Source # get :: BinHandle -> IO IfaceCoercion Source #
Binary IfaceTyLit # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceTyLit -> IO () Source # put :: BinHandle -> IfaceTyLit -> IO (Bin IfaceTyLit) Source # get :: BinHandle -> IO IfaceTyLit Source #
Binary IfaceTyCon # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceTyCon -> IO () Source # put :: BinHandle -> IfaceTyCon -> IO (Bin IfaceTyCon) Source # get :: BinHandle -> IO IfaceTyCon Source #
Binary IfaceType # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceType -> IO () Source # put :: BinHandle -> IfaceType -> IO (Bin IfaceType) Source # get :: BinHandle -> IO IfaceType Source #
Binary IfaceAppArgs # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceAppArgs -> IO () Source # put :: BinHandle -> IfaceAppArgs -> IO (Bin IfaceAppArgs) Source # get :: BinHandle -> IO IfaceAppArgs Source #
Binary CCFlavour # |
Instance details Defined in CostCentre Methods put_ :: BinHandle -> CCFlavour -> IO () Source # put :: BinHandle -> CCFlavour -> IO (Bin CCFlavour) Source # get :: BinHandle -> IO CCFlavour Source #
Binary CostCentre # |
Instance details Defined in CostCentre Methods put_ :: BinHandle -> CostCentre -> IO () Source # put :: BinHandle -> CostCentre -> IO (Bin CostCentre) Source # get :: BinHandle -> IO CostCentre Source #
Binary Role # |
Instance details Defined in CoAxiom Methods put_ :: BinHandle -> Role -> IO () Source # put :: BinHandle -> Role -> IO (Bin Role) Source # get :: BinHandle -> IO Role Source #
Binary PrimElemRep # |
Instance details Defined in TyCon Methods put_ :: BinHandle -> PrimElemRep -> IO () Source # put :: BinHandle -> PrimElemRep -> IO (Bin PrimElemRep) Source # get :: BinHandle -> IO PrimElemRep Source #
Binary Injectivity # |
Instance details Defined in TyCon Methods put_ :: BinHandle -> Injectivity -> IO () Source # put :: BinHandle -> Injectivity -> IO (Bin Injectivity) Source # get :: BinHandle -> IO Injectivity Source #
Binary TyConBndrVis # |
Instance details Defined in TyCon Methods put_ :: BinHandle -> TyConBndrVis -> IO () Source # put :: BinHandle -> TyConBndrVis -> IO (Bin TyConBndrVis) Source # get :: BinHandle -> IO TyConBndrVis Source #
Binary IfaceUnivCoProv # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceUnivCoProv -> IO () Source # put :: BinHandle -> IfaceUnivCoProv -> IO (Bin IfaceUnivCoProv) Source # get :: BinHandle -> IO IfaceUnivCoProv Source #
Binary IfaceMCoercion # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceMCoercion -> IO () Source # put :: BinHandle -> IfaceMCoercion -> IO (Bin IfaceMCoercion) Source # get :: BinHandle -> IO IfaceMCoercion Source #
Binary IfaceTyConInfo # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceTyConInfo -> IO () Source # put :: BinHandle -> IfaceTyConInfo -> IO (Bin IfaceTyConInfo) Source # get :: BinHandle -> IO IfaceTyConInfo Source #
Binary IfaceTyConSort # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceTyConSort -> IO () Source # put :: BinHandle -> IfaceTyConSort -> IO (Bin IfaceTyConSort) Source # get :: BinHandle -> IO IfaceTyConSort Source #
Binary IfaceOneShot # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceOneShot -> IO () Source # put :: BinHandle -> IfaceOneShot -> IO (Bin IfaceOneShot) Source # get :: BinHandle -> IO IfaceOneShot Source #
Binary TyVarScope # |
Instance details Defined in HieTypes Methods put_ :: BinHandle -> TyVarScope -> IO () Source # put :: BinHandle -> TyVarScope -> IO (Bin TyVarScope) Source # get :: BinHandle -> IO TyVarScope Source #
Binary Scope # |
Instance details Defined in HieTypes Methods put_ :: BinHandle -> Scope -> IO () Source # put :: BinHandle -> Scope -> IO (Bin Scope) Source # get :: BinHandle -> IO Scope Source #
Binary DeclType # |
Instance details Defined in HieTypes Methods put_ :: BinHandle -> DeclType -> IO () Source # put :: BinHandle -> DeclType -> IO (Bin DeclType) Source # get :: BinHandle -> IO DeclType Source #
Binary BindType # |
Instance details Defined in HieTypes Methods put_ :: BinHandle -> BindType -> IO () Source # put :: BinHandle -> BindType -> IO (Bin BindType) Source # get :: BinHandle -> IO BindType Source #
Binary RecFieldContext # |
Instance details Defined in HieTypes Methods put_ :: BinHandle -> RecFieldContext -> IO () Source # put :: BinHandle -> RecFieldContext -> IO (Bin RecFieldContext) Source # get :: BinHandle -> IO RecFieldContext Source #
Binary IEType # |
Instance details Defined in HieTypes Methods put_ :: BinHandle -> IEType -> IO () Source # put :: BinHandle -> IEType -> IO (Bin IEType) Source # get :: BinHandle -> IO IEType Source #
Binary ContextInfo # |
Instance details Defined in HieTypes Methods put_ :: BinHandle -> ContextInfo -> IO () Source # put :: BinHandle -> ContextInfo -> IO (Bin ContextInfo) Source # get :: BinHandle -> IO ContextInfo Source #
Binary HieFile # |
Instance details Defined in HieTypes Methods put_ :: BinHandle -> HieFile -> IO () Source # put :: BinHandle -> HieFile -> IO (Bin HieFile) Source # get :: BinHandle -> IO HieFile Source #
Binary LitNumType # |
Instance details Defined in Literal Methods put_ :: BinHandle -> LitNumType -> IO () Source # put :: BinHandle -> LitNumType -> IO (Bin LitNumType) Source # get :: BinHandle -> IO LitNumType Source #
Binary Literal # |
Instance details Defined in Literal Methods put_ :: BinHandle -> Literal -> IO () Source # put :: BinHandle -> Literal -> IO (Bin Literal) Source # get :: BinHandle -> IO Literal Source #
Binary SrcUnpackedness # |
Instance details Defined in DataCon Methods put_ :: BinHandle -> SrcUnpackedness -> IO () Source # put :: BinHandle -> SrcUnpackedness -> IO (Bin SrcUnpackedness) Source # get :: BinHandle -> IO SrcUnpackedness Source #
Binary SrcStrictness # |
Instance details Defined in DataCon Methods put_ :: BinHandle -> SrcStrictness -> IO () Source # put :: BinHandle -> SrcStrictness -> IO (Bin SrcStrictness) Source # get :: BinHandle -> IO SrcStrictness Source #
Binary StrictSig # |
Instance details Defined in Demand Methods put_ :: BinHandle -> StrictSig -> IO () Source # put :: BinHandle -> StrictSig -> IO (Bin StrictSig) Source # get :: BinHandle -> IO StrictSig Source #
Binary DmdType # |
Instance details Defined in Demand Methods put_ :: BinHandle -> DmdType -> IO () Source # put :: BinHandle -> DmdType -> IO (Bin DmdType) Source # get :: BinHandle -> IO DmdType Source #
Binary CPRResult # |
Instance details Defined in Demand Methods put_ :: BinHandle -> CPRResult -> IO () Source # put :: BinHandle -> CPRResult -> IO (Bin CPRResult) Source # get :: BinHandle -> IO CPRResult Source #
Binary DmdResult # |
Instance details Defined in Demand Methods put_ :: BinHandle -> DmdResult -> IO () Source # put :: BinHandle -> DmdResult -> IO (Bin DmdResult) Source # get :: BinHandle -> IO DmdResult Source #
Binary Count # |
Instance details Defined in Demand Methods put_ :: BinHandle -> Count -> IO () Source # put :: BinHandle -> Count -> IO (Bin Count) Source # get :: BinHandle -> IO Count Source #
Binary UseDmd # |
Instance details Defined in Demand Methods put_ :: BinHandle -> UseDmd -> IO () Source # put :: BinHandle -> UseDmd -> IO (Bin UseDmd) Source # get :: BinHandle -> IO UseDmd Source #
Binary StrDmd # |
Instance details Defined in Demand Methods put_ :: BinHandle -> StrDmd -> IO () Source # put :: BinHandle -> StrDmd -> IO (Bin StrDmd) Source # get :: BinHandle -> IO StrDmd Source #
Binary IsOrphan # |
Instance details Defined in CoreSyn Methods put_ :: BinHandle -> IsOrphan -> IO () Source # put :: BinHandle -> IsOrphan -> IO (Bin IsOrphan) Source # get :: BinHandle -> IO IsOrphan Source #
Binary IfaceJoinInfo # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceJoinInfo -> IO () Source # put :: BinHandle -> IfaceJoinInfo -> IO (Bin IfaceJoinInfo) Source # get :: BinHandle -> IO IfaceJoinInfo Source #
Binary IfaceLetBndr # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceLetBndr -> IO () Source # put :: BinHandle -> IfaceLetBndr -> IO (Bin IfaceLetBndr) Source # get :: BinHandle -> IO IfaceLetBndr Source #
Binary IfaceBinding # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceBinding -> IO () Source # put :: BinHandle -> IfaceBinding -> IO (Bin IfaceBinding) Source # get :: BinHandle -> IO IfaceBinding Source #
Binary IfaceConAlt # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceConAlt -> IO () Source # put :: BinHandle -> IfaceConAlt -> IO (Bin IfaceConAlt) Source # get :: BinHandle -> IO IfaceConAlt Source #
Binary IfaceTickish # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceTickish -> IO () Source # put :: BinHandle -> IfaceTickish -> IO (Bin IfaceTickish) Source # get :: BinHandle -> IO IfaceTickish Source #
Binary IfaceExpr # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceExpr -> IO () Source # put :: BinHandle -> IfaceExpr -> IO (Bin IfaceExpr) Source # get :: BinHandle -> IO IfaceExpr Source #
Binary IfaceIdDetails # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceIdDetails -> IO () Source # put :: BinHandle -> IfaceIdDetails -> IO (Bin IfaceIdDetails) Source # get :: BinHandle -> IO IfaceIdDetails Source #
Binary IfaceUnfolding # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceUnfolding -> IO () Source # put :: BinHandle -> IfaceUnfolding -> IO (Bin IfaceUnfolding) Source # get :: BinHandle -> IO IfaceUnfolding Source #
Binary IfaceInfoItem # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceInfoItem -> IO () Source # put :: BinHandle -> IfaceInfoItem -> IO (Bin IfaceInfoItem) Source # get :: BinHandle -> IO IfaceInfoItem Source #
Binary IfaceIdInfo # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceIdInfo -> IO () Source # put :: BinHandle -> IfaceIdInfo -> IO (Bin IfaceIdInfo) Source # get :: BinHandle -> IO IfaceIdInfo Source #
Binary IfaceCompleteMatch # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceCompleteMatch -> IO () Source # put :: BinHandle -> IfaceCompleteMatch -> IO (Bin IfaceCompleteMatch) Source # get :: BinHandle -> IO IfaceCompleteMatch Source #
Binary IfaceAnnotation # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceAnnotation -> IO () Source # put :: BinHandle -> IfaceAnnotation -> IO (Bin IfaceAnnotation) Source # get :: BinHandle -> IO IfaceAnnotation Source #
Binary IfaceRule # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceRule -> IO () Source # put :: BinHandle -> IfaceRule -> IO (Bin IfaceRule) Source # get :: BinHandle -> IO IfaceRule Source #
Binary IfaceFamInst # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceFamInst -> IO () Source # put :: BinHandle -> IfaceFamInst -> IO (Bin IfaceFamInst) Source # get :: BinHandle -> IO IfaceFamInst Source #
Binary IfaceClsInst # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceClsInst -> IO () Source # put :: BinHandle -> IfaceClsInst -> IO (Bin IfaceClsInst) Source # get :: BinHandle -> IO IfaceClsInst Source #
Binary IfaceSrcBang # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceSrcBang -> IO () Source # put :: BinHandle -> IfaceSrcBang -> IO (Bin IfaceSrcBang) Source # get :: BinHandle -> IO IfaceSrcBang Source #
Binary IfaceBang # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceBang -> IO () Source # put :: BinHandle -> IfaceBang -> IO (Bin IfaceBang) Source # get :: BinHandle -> IO IfaceBang Source #
Binary IfaceConDecl # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceConDecl -> IO () Source # put :: BinHandle -> IfaceConDecl -> IO (Bin IfaceConDecl) Source # get :: BinHandle -> IO IfaceConDecl Source #
Binary IfaceConDecls # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceConDecls -> IO () Source # put :: BinHandle -> IfaceConDecls -> IO (Bin IfaceConDecls) Source # get :: BinHandle -> IO IfaceConDecls Source #
Binary IfaceAxBranch # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceAxBranch -> IO () Source # put :: BinHandle -> IfaceAxBranch -> IO (Bin IfaceAxBranch) Source # get :: BinHandle -> IO IfaceAxBranch Source #
Binary IfaceAT # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceAT -> IO () Source # put :: BinHandle -> IfaceAT -> IO (Bin IfaceAT) Source # get :: BinHandle -> IO IfaceAT Source #
Binary IfaceClassOp # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceClassOp -> IO () Source # put :: BinHandle -> IfaceClassOp -> IO (Bin IfaceClassOp) Source # get :: BinHandle -> IO IfaceClassOp Source #
Binary IfaceFamTyConFlav # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceFamTyConFlav -> IO () Source # put :: BinHandle -> IfaceFamTyConFlav -> IO (Bin IfaceFamTyConFlav) Source # get :: BinHandle -> IO IfaceFamTyConFlav Source #
Binary IfaceTyConParent # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceTyConParent -> IO () Source # put :: BinHandle -> IfaceTyConParent -> IO (Bin IfaceTyConParent) Source # get :: BinHandle -> IO IfaceTyConParent Source #
Binary IfaceDecl # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceDecl -> IO () Source # put :: BinHandle -> IfaceDecl -> IO (Bin IfaceDecl) Source # get :: BinHandle -> IO IfaceDecl Source #
Binary IfaceTrustInfo # |
Instance details Defined in HscTypes Methods put_ :: BinHandle -> IfaceTrustInfo -> IO () Source # put :: BinHandle -> IfaceTrustInfo -> IO (Bin IfaceTrustInfo) Source # get :: BinHandle -> IO IfaceTrustInfo Source #
Binary Usage # |
Instance details Defined in HscTypes Methods put_ :: BinHandle -> Usage -> IO () Source # put :: BinHandle -> Usage -> IO (Bin Usage) Source # get :: BinHandle -> IO Usage Source #
Binary Dependencies # |
Instance details Defined in HscTypes Methods put_ :: BinHandle -> Dependencies -> IO () Source # put :: BinHandle -> Dependencies -> IO (Bin Dependencies) Source # get :: BinHandle -> IO Dependencies Source #
Binary Warnings # |
Instance details Defined in HscTypes Methods put_ :: BinHandle -> Warnings -> IO () Source # put :: BinHandle -> Warnings -> IO (Bin Warnings) Source # get :: BinHandle -> IO Warnings Source #
Binary ModIface # |
Instance details Defined in HscTypes Methods put_ :: BinHandle -> ModIface -> IO () Source # put :: BinHandle -> ModIface -> IO (Bin ModIface) Source # get :: BinHandle -> IO ModIface Source #
Binary a => Binary [a] # |
Instance details Defined in Binary Methods put_ :: BinHandle -> [a] -> IO () Source # put :: BinHandle -> [a] -> IO (Bin [a]) Source # get :: BinHandle -> IO [a] Source #
Binary a => Binary (Maybe a) # |
Instance details Defined in 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 (Ratio a) # |
Instance details Defined in 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 (Located a) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Located a -> IO () Source # put :: BinHandle -> Located a -> IO (Bin (Located a)) Source # get :: BinHandle -> IO (Located a) Source #
Binary (DefMethSpec IfaceType) # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> DefMethSpec IfaceType -> IO () Source # put :: BinHandle -> DefMethSpec IfaceType -> IO (Bin (DefMethSpec IfaceType)) Source # get :: BinHandle -> IO (DefMethSpec IfaceType) Source #
Binary a => Binary (BooleanFormula a) # |
Instance details Defined in BooleanFormula Methods put_ :: BinHandle -> BooleanFormula a -> IO () Source # put :: BinHandle -> BooleanFormula a -> IO (Bin (BooleanFormula a)) Source # get :: BinHandle -> IO (BooleanFormula a) Source #
Binary a => Binary (FieldLbl a) # |
Instance details Defined in FieldLabel Methods put_ :: BinHandle -> FieldLbl a -> IO () Source # put :: BinHandle -> FieldLbl a -> IO (Bin (FieldLbl a)) Source # get :: BinHandle -> IO (FieldLbl a) Source #
Binary name => Binary (AnnTarget name) # |
Instance details Defined in Annotations Methods put_ :: BinHandle -> AnnTarget name -> IO () Source # put :: BinHandle -> AnnTarget name -> IO (Bin (AnnTarget name)) Source # get :: BinHandle -> IO (AnnTarget name) Source #
Binary (IdentifierDetails TypeIndex) # |
Instance details Defined in HieTypes Methods put_ :: BinHandle -> IdentifierDetails TypeIndex -> IO () Source # put :: BinHandle -> IdentifierDetails TypeIndex -> IO (Bin (IdentifierDetails TypeIndex)) Source # get :: BinHandle -> IO (IdentifierDetails TypeIndex) Source #
Binary (NodeInfo TypeIndex) # |
Instance details Defined in HieTypes Methods put_ :: BinHandle -> NodeInfo TypeIndex -> IO () Source # put :: BinHandle -> NodeInfo TypeIndex -> IO (Bin (NodeInfo TypeIndex)) Source # get :: BinHandle -> IO (NodeInfo TypeIndex) Source #
Binary (HieAST TypeIndex) # |
Instance details Defined in HieTypes Methods put_ :: BinHandle -> HieAST TypeIndex -> IO () Source # put :: BinHandle -> HieAST TypeIndex -> IO (Bin (HieAST TypeIndex)) Source # get :: BinHandle -> IO (HieAST TypeIndex) Source #
Binary (HieASTs TypeIndex) # |
Instance details Defined in HieTypes Methods put_ :: BinHandle -> HieASTs TypeIndex -> IO () Source # put :: BinHandle -> HieASTs TypeIndex -> IO (Bin (HieASTs TypeIndex)) Source # get :: BinHandle -> IO (HieASTs TypeIndex) Source #
Binary (HieArgs TypeIndex) # |
Instance details Defined in HieTypes Methods put_ :: BinHandle -> HieArgs TypeIndex -> IO () Source # put :: BinHandle -> HieArgs TypeIndex -> IO (Bin (HieArgs TypeIndex)) Source # get :: BinHandle -> IO (HieArgs TypeIndex) Source #
Binary (HieType TypeIndex) # |
Instance details Defined in HieTypes Methods put_ :: BinHandle -> HieType TypeIndex -> IO () Source # put :: BinHandle -> HieType TypeIndex -> IO (Bin (HieType TypeIndex)) Source # get :: BinHandle -> IO (HieType TypeIndex) Source #
(Binary a, Binary b) => Binary (Either a b) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Either a b -> IO () Source # put :: BinHandle -> Either a b -> IO (Bin (Either a b)) Source # get :: BinHandle -> IO (Either a b) Source #
Typeable a => Binary (TypeRep a) # |
Instance details Defined in Binary 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) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> (a, b) -> IO () Source # put :: BinHandle -> (a, b) -> IO (Bin (a, b)) Source # get :: BinHandle -> IO (a, b) Source #
(Ix a, Binary a, Binary b) => Binary (Array a b) # |
Instance details Defined in 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 (Bin a) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Bin a -> IO () Source # put :: BinHandle -> Bin a -> IO (Bin (Bin a)) Source # get :: BinHandle -> IO (Bin a) Source #
(Binary tv, Binary vis) => Binary (VarBndr tv vis) # |
Instance details Defined in 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 a, Binary b, Binary c) => Binary (a, b, c) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> (a, b, c) -> IO () Source # put :: BinHandle -> (a, b, c) -> IO (Bin (a, b, c)) Source # get :: BinHandle -> IO (a, b, c) Source #
(Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> (a, b, c, d) -> IO () Source # put :: BinHandle -> (a, b, c, d) -> IO (Bin (a, b, c, d)) Source # get :: BinHandle -> IO (a, b, c, d) Source #
(Binary a, Binary b, Binary c, Binary d, Binary e) => Binary (a, b, c, d, e) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> (a, b, c, d, e) -> IO () Source # put :: BinHandle -> (a, b, c, d, e) -> IO (Bin (a, b, c, d, e)) Source # get :: BinHandle -> IO (a, b, c, d, e) Source #
(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f) => Binary (a, b, c, d, e, f) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> (a, b, c, d, e, f) -> IO () Source # put :: BinHandle -> (a, b, c, d, e, f) -> IO (Bin (a, b, c, d, e, f)) Source # get :: BinHandle -> IO (a, b, c, d, e, f) Source #
(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f, Binary g) => Binary (a, b, c, d, e, f, g) # |
Instance details Defined in 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 BinHandle Source #

type SymbolTable = Array Int Name Source #

type Dictionary = Array Int FastString Source #

openBinMem :: Int -> IO BinHandle Source #

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

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

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

castBin :: Bin a -> Bin b Source #

isEOFBin :: BinHandle -> IO Bool Source #

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

Get access to the underlying buffer.

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

writeBinMem :: BinHandle -> FilePath -> IO () Source #

readBinMem :: FilePath -> IO BinHandle Source #

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

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

# For writing instances

putByte :: BinHandle -> Word8 -> IO () Source #

getByte :: BinHandle -> IO Word8 Source #

# Variable length encodings

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

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

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

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

# Lazy Binary I/O

lazyGet :: Binary a => BinHandle -> IO a Source #

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

# User data

data UserData Source #

Information we keep around during interface file serialization/deserialization. Namely we keep the functions for serializing and deserializing `Name`s and `FastString`s. 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 BinIface).
- 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 ud_get_name :: BinHandle -> IO Name ud_get_fs :: BinHandle -> IO FastString ud_put_nonbinding_name :: BinHandle -> Name -> IO () serialize a non-binding `Name` (e.g. a reference to another binding). ud_put_binding_name :: BinHandle -> Name -> IO () serialize a binding `Name` (e.g. the name of an IfaceDecl) ud_put_fs :: BinHandle -> FastString -> IO ()

getUserData :: BinHandle -> UserData Source #

setUserData :: BinHandle -> UserData -> BinHandle Source #

newReadState Source #

Arguments

:: (BinHandle -> IO Name) | how to deserialize `Name`s
-> (BinHandle -> IO FastString) |
-> UserData |

newWriteState Source #

Arguments

:: (BinHandle -> Name -> IO ()) | how to serialize non-binding `Name`s
-> (BinHandle -> Name -> IO ()) | how to serialize binding `Name`s
-> (BinHandle -> FastString -> IO ()) |
-> UserData |

putDictionary :: BinHandle -> Int -> UniqFM (Int, FastString) -> IO () Source #

getDictionary :: BinHandle -> IO Dictionary Source #

putFS :: BinHandle -> FastString -> IO () Source #