Binary

ghc-8.6.3: The GHC API

Safe Haskell | None
Language | Haskell2010

Binary

Contents

- For writing instances
- 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
- 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 #

Instances

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 () # put :: BinHandle -> Bin a -> IO (Bin (Bin a)) # get :: BinHandle -> IO (Bin a) #

class Binary a where #

Minimal complete definition

get

Methods

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

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

get :: BinHandle -> IO a #

Instances

Binary Bool # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Bool -> IO () # put :: BinHandle -> Bool -> IO (Bin Bool) # get :: BinHandle -> IO Bool #
Binary Char # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Char -> IO () # put :: BinHandle -> Char -> IO (Bin Char) # get :: BinHandle -> IO Char #
Binary Int # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Int -> IO () # put :: BinHandle -> Int -> IO (Bin Int) # get :: BinHandle -> IO Int #
Binary Int8 # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Int8 -> IO () # put :: BinHandle -> Int8 -> IO (Bin Int8) # get :: BinHandle -> IO Int8 #
Binary Int16 # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Int16 -> IO () # put :: BinHandle -> Int16 -> IO (Bin Int16) # get :: BinHandle -> IO Int16 #
Binary Int32 # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Int32 -> IO () # put :: BinHandle -> Int32 -> IO (Bin Int32) # get :: BinHandle -> IO Int32 #
Binary Int64 # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Int64 -> IO () # put :: BinHandle -> Int64 -> IO (Bin Int64) # get :: BinHandle -> IO Int64 #
Binary Integer # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Integer -> IO () # put :: BinHandle -> Integer -> IO (Bin Integer) # get :: BinHandle -> IO Integer #
Binary Word8 # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Word8 -> IO () # put :: BinHandle -> Word8 -> IO (Bin Word8) # get :: BinHandle -> IO Word8 #
Binary Word16 # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Word16 -> IO () # put :: BinHandle -> Word16 -> IO (Bin Word16) # get :: BinHandle -> IO Word16 #
Binary Word32 # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Word32 -> IO () # put :: BinHandle -> Word32 -> IO (Bin Word32) # get :: BinHandle -> IO Word32 #
Binary Word64 # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Word64 -> IO () # put :: BinHandle -> Word64 -> IO (Bin Word64) # get :: BinHandle -> IO Word64 #
Binary RuntimeRep # |
Instance details Defined in Binary Methods put_ :: BinHandle -> RuntimeRep -> IO () # put :: BinHandle -> RuntimeRep -> IO (Bin RuntimeRep) # get :: BinHandle -> IO RuntimeRep #
Binary VecCount # |
Instance details Defined in Binary Methods put_ :: BinHandle -> VecCount -> IO () # put :: BinHandle -> VecCount -> IO (Bin VecCount) # get :: BinHandle -> IO VecCount #
Binary VecElem # |
Instance details Defined in Binary Methods put_ :: BinHandle -> VecElem -> IO () # put :: BinHandle -> VecElem -> IO (Bin VecElem) # get :: BinHandle -> IO VecElem #
Binary SomeTypeRep # |
Instance details Defined in Binary Methods put_ :: BinHandle -> SomeTypeRep -> IO () # put :: BinHandle -> SomeTypeRep -> IO (Bin SomeTypeRep) # get :: BinHandle -> IO SomeTypeRep #
Binary () # |
Instance details Defined in Binary Methods put_ :: BinHandle -> () -> IO () # put :: BinHandle -> () -> IO (Bin ()) # get :: BinHandle -> IO () #
Binary TyCon # |
Instance details Defined in Binary Methods put_ :: BinHandle -> TyCon -> IO () # put :: BinHandle -> TyCon -> IO (Bin TyCon) # get :: BinHandle -> IO TyCon #
Binary KindRep # |
Instance details Defined in Binary Methods put_ :: BinHandle -> KindRep -> IO () # put :: BinHandle -> KindRep -> IO (Bin KindRep) # get :: BinHandle -> IO KindRep #
Binary TypeLitSort # |
Instance details Defined in Binary Methods put_ :: BinHandle -> TypeLitSort -> IO () # put :: BinHandle -> TypeLitSort -> IO (Bin TypeLitSort) # get :: BinHandle -> IO TypeLitSort #
Binary Fingerprint # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Fingerprint -> IO () # put :: BinHandle -> Fingerprint -> IO (Bin Fingerprint) # get :: BinHandle -> IO Fingerprint #
Binary ByteString # |
Instance details Defined in Binary Methods put_ :: BinHandle -> ByteString -> IO () # put :: BinHandle -> ByteString -> IO (Bin ByteString) # get :: BinHandle -> IO ByteString #
Binary Serialized # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Serialized -> IO () # put :: BinHandle -> Serialized -> IO (Bin Serialized) # get :: BinHandle -> IO Serialized #
Binary UTCTime # |
Instance details Defined in Binary Methods put_ :: BinHandle -> UTCTime -> IO () # put :: BinHandle -> UTCTime -> IO (Bin UTCTime) # get :: BinHandle -> IO UTCTime #
Binary DiffTime # |
Instance details Defined in Binary Methods put_ :: BinHandle -> DiffTime -> IO () # put :: BinHandle -> DiffTime -> IO (Bin DiffTime) # get :: BinHandle -> IO DiffTime #
Binary Day # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Day -> IO () # put :: BinHandle -> Day -> IO (Bin Day) # get :: BinHandle -> IO Day #
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 () # put :: BinHandle -> Name -> IO (Bin Name) # get :: BinHandle -> IO Name #
Binary OccName # |
Instance details Defined in OccName Methods put_ :: BinHandle -> OccName -> IO () # put :: BinHandle -> OccName -> IO (Bin OccName) # get :: BinHandle -> IO OccName #
Binary FastString # |
Instance details Defined in Binary Methods put_ :: BinHandle -> FastString -> IO () # put :: BinHandle -> FastString -> IO (Bin FastString) # get :: BinHandle -> IO FastString #
Binary ComponentId # |
Instance details Defined in Module Methods put_ :: BinHandle -> ComponentId -> IO () # put :: BinHandle -> ComponentId -> IO (Bin ComponentId) # get :: BinHandle -> IO ComponentId #
Binary InstalledUnitId # |
Instance details Defined in Module Methods put_ :: BinHandle -> InstalledUnitId -> IO () # put :: BinHandle -> InstalledUnitId -> IO (Bin InstalledUnitId) # get :: BinHandle -> IO InstalledUnitId #
Binary UnitId # |
Instance details Defined in Module Methods put_ :: BinHandle -> UnitId -> IO () # put :: BinHandle -> UnitId -> IO (Bin UnitId) # get :: BinHandle -> IO UnitId #
Binary ModuleName # |
Instance details Defined in Module Methods put_ :: BinHandle -> ModuleName -> IO () # put :: BinHandle -> ModuleName -> IO (Bin ModuleName) # get :: BinHandle -> IO ModuleName #
Binary Module # |
Instance details Defined in Module Methods put_ :: BinHandle -> Module -> IO () # put :: BinHandle -> Module -> IO (Bin Module) # get :: BinHandle -> IO Module #
Binary SrcSpan # |
Instance details Defined in Binary Methods put_ :: BinHandle -> SrcSpan -> IO () # put :: BinHandle -> SrcSpan -> IO (Bin SrcSpan) # get :: BinHandle -> IO SrcSpan #
Binary InlineSpec # |
Instance details Defined in Binary Methods put_ :: BinHandle -> InlineSpec -> IO () # put :: BinHandle -> InlineSpec -> IO (Bin InlineSpec) # get :: BinHandle -> IO InlineSpec #
Binary InlinePragma # |
Instance details Defined in Binary Methods put_ :: BinHandle -> InlinePragma -> IO () # put :: BinHandle -> InlinePragma -> IO (Bin InlinePragma) # get :: BinHandle -> IO InlinePragma #
Binary RuleMatchInfo # |
Instance details Defined in Binary Methods put_ :: BinHandle -> RuleMatchInfo -> IO () # put :: BinHandle -> RuleMatchInfo -> IO (Bin RuleMatchInfo) # get :: BinHandle -> IO RuleMatchInfo #
Binary Activation # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Activation -> IO () # put :: BinHandle -> Activation -> IO (Bin Activation) # get :: BinHandle -> IO Activation #
Binary SourceText # |
Instance details Defined in Binary Methods put_ :: BinHandle -> SourceText -> IO () # put :: BinHandle -> SourceText -> IO (Bin SourceText) # get :: BinHandle -> IO SourceText #
Binary TupleSort # |
Instance details Defined in Binary Methods put_ :: BinHandle -> TupleSort -> IO () # put :: BinHandle -> TupleSort -> IO (Bin TupleSort) # get :: BinHandle -> IO TupleSort #
Binary OverlapMode # |
Instance details Defined in Binary Methods put_ :: BinHandle -> OverlapMode -> IO () # put :: BinHandle -> OverlapMode -> IO (Bin OverlapMode) # get :: BinHandle -> IO OverlapMode #
Binary OverlapFlag # |
Instance details Defined in Binary Methods put_ :: BinHandle -> OverlapFlag -> IO () # put :: BinHandle -> OverlapFlag -> IO (Bin OverlapFlag) # get :: BinHandle -> IO OverlapFlag #
Binary RecFlag # |
Instance details Defined in Binary Methods put_ :: BinHandle -> RecFlag -> IO () # put :: BinHandle -> RecFlag -> IO (Bin RecFlag) # get :: BinHandle -> IO RecFlag #
Binary FixityDirection # |
Instance details Defined in Binary Methods put_ :: BinHandle -> FixityDirection -> IO () # put :: BinHandle -> FixityDirection -> IO (Bin FixityDirection) # get :: BinHandle -> IO FixityDirection #
Binary Fixity # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Fixity -> IO () # put :: BinHandle -> Fixity -> IO (Bin Fixity) # get :: BinHandle -> IO Fixity #
Binary WarningTxt # |
Instance details Defined in Binary Methods put_ :: BinHandle -> WarningTxt -> IO () # put :: BinHandle -> WarningTxt -> IO (Bin WarningTxt) # get :: BinHandle -> IO WarningTxt #
Binary StringLiteral # |
Instance details Defined in Binary Methods put_ :: BinHandle -> StringLiteral -> IO () # put :: BinHandle -> StringLiteral -> IO (Bin StringLiteral) # get :: BinHandle -> IO StringLiteral #
Binary FunctionOrData # |
Instance details Defined in Binary Methods put_ :: BinHandle -> FunctionOrData -> IO () # put :: BinHandle -> FunctionOrData -> IO (Bin FunctionOrData) # get :: BinHandle -> IO FunctionOrData #
Binary LeftOrRight # |
Instance details Defined in Binary Methods put_ :: BinHandle -> LeftOrRight -> IO () # put :: BinHandle -> LeftOrRight -> IO (Bin LeftOrRight) # get :: BinHandle -> IO LeftOrRight #
Binary DefUnitId # |
Instance details Defined in Module Methods put_ :: BinHandle -> DefUnitId -> IO () # put :: BinHandle -> DefUnitId -> IO (Bin DefUnitId) # get :: BinHandle -> IO DefUnitId #
Binary IndefUnitId # |
Instance details Defined in Module Methods put_ :: BinHandle -> IndefUnitId -> IO () # put :: BinHandle -> IndefUnitId -> IO (Bin IndefUnitId) # get :: BinHandle -> IO IndefUnitId #
Binary CType # |
Instance details Defined in ForeignCall Methods put_ :: BinHandle -> CType -> IO () # put :: BinHandle -> CType -> IO (Bin CType) # get :: BinHandle -> IO CType #
Binary Header # |
Instance details Defined in ForeignCall Methods put_ :: BinHandle -> Header -> IO () # put :: BinHandle -> Header -> IO (Bin Header) # get :: BinHandle -> IO Header #
Binary CCallConv # |
Instance details Defined in ForeignCall Methods put_ :: BinHandle -> CCallConv -> IO () # put :: BinHandle -> CCallConv -> IO (Bin CCallConv) # get :: BinHandle -> IO CCallConv #
Binary CCallTarget # |
Instance details Defined in ForeignCall Methods put_ :: BinHandle -> CCallTarget -> IO () # put :: BinHandle -> CCallTarget -> IO (Bin CCallTarget) # get :: BinHandle -> IO CCallTarget #
Binary CCallSpec # |
Instance details Defined in ForeignCall Methods put_ :: BinHandle -> CCallSpec -> IO () # put :: BinHandle -> CCallSpec -> IO (Bin CCallSpec) # get :: BinHandle -> IO CCallSpec #
Binary CExportSpec # |
Instance details Defined in ForeignCall Methods put_ :: BinHandle -> CExportSpec -> IO () # put :: BinHandle -> CExportSpec -> IO (Bin CExportSpec) # get :: BinHandle -> IO CExportSpec #
Binary Safety # |
Instance details Defined in ForeignCall Methods put_ :: BinHandle -> Safety -> IO () # put :: BinHandle -> Safety -> IO (Bin Safety) # get :: BinHandle -> IO Safety #
Binary ForeignCall # |
Instance details Defined in ForeignCall Methods put_ :: BinHandle -> ForeignCall -> IO () # put :: BinHandle -> ForeignCall -> IO (Bin ForeignCall) # get :: BinHandle -> IO ForeignCall #
Binary CostCentreIndex # |
Instance details Defined in CostCentreState Methods put_ :: BinHandle -> CostCentreIndex -> IO () # put :: BinHandle -> CostCentreIndex -> IO (Bin CostCentreIndex) # get :: BinHandle -> IO CostCentreIndex #
Binary HscSource # |
Instance details Defined in DriverPhases Methods put_ :: BinHandle -> HscSource -> IO () # put :: BinHandle -> HscSource -> IO (Bin HscSource) # get :: BinHandle -> IO HscSource #
Binary NameSpace # |
Instance details Defined in OccName Methods put_ :: BinHandle -> NameSpace -> IO () # put :: BinHandle -> NameSpace -> IO (Bin NameSpace) # get :: BinHandle -> IO NameSpace #
Binary ArgDocMap # |
Instance details Defined in HsDoc Methods put_ :: BinHandle -> ArgDocMap -> IO () # put :: BinHandle -> ArgDocMap -> IO (Bin ArgDocMap) # get :: BinHandle -> IO ArgDocMap #
Binary DeclDocMap # |
Instance details Defined in HsDoc Methods put_ :: BinHandle -> DeclDocMap -> IO () # put :: BinHandle -> DeclDocMap -> IO (Bin DeclDocMap) # get :: BinHandle -> IO DeclDocMap #
Binary HsDocString # |
Instance details Defined in HsDoc Methods put_ :: BinHandle -> HsDocString -> IO () # put :: BinHandle -> HsDocString -> IO (Bin HsDocString) # get :: BinHandle -> IO HsDocString #
Binary AvailInfo # |
Instance details Defined in Avail Methods put_ :: BinHandle -> AvailInfo -> IO () # put :: BinHandle -> AvailInfo -> IO (Bin AvailInfo) # get :: BinHandle -> IO AvailInfo #
Binary ArgFlag # |
Instance details Defined in Var Methods put_ :: BinHandle -> ArgFlag -> IO () # put :: BinHandle -> ArgFlag -> IO (Bin ArgFlag) # get :: BinHandle -> IO ArgFlag #
Binary IfaceCoercion # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceCoercion -> IO () # put :: BinHandle -> IfaceCoercion -> IO (Bin IfaceCoercion) # get :: BinHandle -> IO IfaceCoercion #
Binary IfaceTyLit # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceTyLit -> IO () # put :: BinHandle -> IfaceTyLit -> IO (Bin IfaceTyLit) # get :: BinHandle -> IO IfaceTyLit #
Binary IfaceTyCon # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceTyCon -> IO () # put :: BinHandle -> IfaceTyCon -> IO (Bin IfaceTyCon) # get :: BinHandle -> IO IfaceTyCon #
Binary IfaceType # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceType -> IO () # put :: BinHandle -> IfaceType -> IO (Bin IfaceType) # get :: BinHandle -> IO IfaceType #
Binary IfaceTcArgs # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceTcArgs -> IO () # put :: BinHandle -> IfaceTcArgs -> IO (Bin IfaceTcArgs) # get :: BinHandle -> IO IfaceTcArgs #
Binary CCFlavour # |
Instance details Defined in CostCentre Methods put_ :: BinHandle -> CCFlavour -> IO () # put :: BinHandle -> CCFlavour -> IO (Bin CCFlavour) # get :: BinHandle -> IO CCFlavour #
Binary CostCentre # |
Instance details Defined in CostCentre Methods put_ :: BinHandle -> CostCentre -> IO () # put :: BinHandle -> CostCentre -> IO (Bin CostCentre) # get :: BinHandle -> IO CostCentre #
Binary Role # |
Instance details Defined in CoAxiom Methods put_ :: BinHandle -> Role -> IO () # put :: BinHandle -> Role -> IO (Bin Role) # get :: BinHandle -> IO Role #
Binary Injectivity # |
Instance details Defined in TyCon Methods put_ :: BinHandle -> Injectivity -> IO () # put :: BinHandle -> Injectivity -> IO (Bin Injectivity) # get :: BinHandle -> IO Injectivity #
Binary TyConBndrVis # |
Instance details Defined in TyCon Methods put_ :: BinHandle -> TyConBndrVis -> IO () # put :: BinHandle -> TyConBndrVis -> IO (Bin TyConBndrVis) # get :: BinHandle -> IO TyConBndrVis #
Binary IfaceUnivCoProv # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceUnivCoProv -> IO () # put :: BinHandle -> IfaceUnivCoProv -> IO (Bin IfaceUnivCoProv) # get :: BinHandle -> IO IfaceUnivCoProv #
Binary IfaceTyConInfo # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceTyConInfo -> IO () # put :: BinHandle -> IfaceTyConInfo -> IO (Bin IfaceTyConInfo) # get :: BinHandle -> IO IfaceTyConInfo #
Binary IfaceTyConSort # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceTyConSort -> IO () # put :: BinHandle -> IfaceTyConSort -> IO (Bin IfaceTyConSort) # get :: BinHandle -> IO IfaceTyConSort #
Binary IsPromoted # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IsPromoted -> IO () # put :: BinHandle -> IsPromoted -> IO (Bin IsPromoted) # get :: BinHandle -> IO IsPromoted #
Binary IfaceOneShot # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceOneShot -> IO () # put :: BinHandle -> IfaceOneShot -> IO (Bin IfaceOneShot) # get :: BinHandle -> IO IfaceOneShot #
Binary IfaceBndr # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> IfaceBndr -> IO () # put :: BinHandle -> IfaceBndr -> IO (Bin IfaceBndr) # get :: BinHandle -> IO IfaceBndr #
Binary LitNumType # |
Instance details Defined in Literal Methods put_ :: BinHandle -> LitNumType -> IO () # put :: BinHandle -> LitNumType -> IO (Bin LitNumType) # get :: BinHandle -> IO LitNumType #
Binary Literal # |
Instance details Defined in Literal Methods put_ :: BinHandle -> Literal -> IO () # put :: BinHandle -> Literal -> IO (Bin Literal) # get :: BinHandle -> IO Literal #
Binary SrcUnpackedness # |
Instance details Defined in DataCon Methods put_ :: BinHandle -> SrcUnpackedness -> IO () # put :: BinHandle -> SrcUnpackedness -> IO (Bin SrcUnpackedness) # get :: BinHandle -> IO SrcUnpackedness #
Binary SrcStrictness # |
Instance details Defined in DataCon Methods put_ :: BinHandle -> SrcStrictness -> IO () # put :: BinHandle -> SrcStrictness -> IO (Bin SrcStrictness) # get :: BinHandle -> IO SrcStrictness #
Binary StrictSig # |
Instance details Defined in Demand Methods put_ :: BinHandle -> StrictSig -> IO () # put :: BinHandle -> StrictSig -> IO (Bin StrictSig) # get :: BinHandle -> IO StrictSig #
Binary DmdType # |
Instance details Defined in Demand Methods put_ :: BinHandle -> DmdType -> IO () # put :: BinHandle -> DmdType -> IO (Bin DmdType) # get :: BinHandle -> IO DmdType #
Binary CPRResult # |
Instance details Defined in Demand Methods put_ :: BinHandle -> CPRResult -> IO () # put :: BinHandle -> CPRResult -> IO (Bin CPRResult) # get :: BinHandle -> IO CPRResult #
Binary DmdResult # |
Instance details Defined in Demand Methods put_ :: BinHandle -> DmdResult -> IO () # put :: BinHandle -> DmdResult -> IO (Bin DmdResult) # get :: BinHandle -> IO DmdResult #
Binary Count # |
Instance details Defined in Demand Methods put_ :: BinHandle -> Count -> IO () # put :: BinHandle -> Count -> IO (Bin Count) # get :: BinHandle -> IO Count #
Binary UseDmd # |
Instance details Defined in Demand Methods put_ :: BinHandle -> UseDmd -> IO () # put :: BinHandle -> UseDmd -> IO (Bin UseDmd) # get :: BinHandle -> IO UseDmd #
Binary StrDmd # |
Instance details Defined in Demand Methods put_ :: BinHandle -> StrDmd -> IO () # put :: BinHandle -> StrDmd -> IO (Bin StrDmd) # get :: BinHandle -> IO StrDmd #
Binary IsOrphan # |
Instance details Defined in CoreSyn Methods put_ :: BinHandle -> IsOrphan -> IO () # put :: BinHandle -> IsOrphan -> IO (Bin IsOrphan) # get :: BinHandle -> IO IsOrphan #
Binary IfaceJoinInfo # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceJoinInfo -> IO () # put :: BinHandle -> IfaceJoinInfo -> IO (Bin IfaceJoinInfo) # get :: BinHandle -> IO IfaceJoinInfo #
Binary IfaceLetBndr # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceLetBndr -> IO () # put :: BinHandle -> IfaceLetBndr -> IO (Bin IfaceLetBndr) # get :: BinHandle -> IO IfaceLetBndr #
Binary IfaceBinding # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceBinding -> IO () # put :: BinHandle -> IfaceBinding -> IO (Bin IfaceBinding) # get :: BinHandle -> IO IfaceBinding #
Binary IfaceConAlt # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceConAlt -> IO () # put :: BinHandle -> IfaceConAlt -> IO (Bin IfaceConAlt) # get :: BinHandle -> IO IfaceConAlt #
Binary IfaceTickish # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceTickish -> IO () # put :: BinHandle -> IfaceTickish -> IO (Bin IfaceTickish) # get :: BinHandle -> IO IfaceTickish #
Binary IfaceExpr # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceExpr -> IO () # put :: BinHandle -> IfaceExpr -> IO (Bin IfaceExpr) # get :: BinHandle -> IO IfaceExpr #
Binary IfaceIdDetails # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceIdDetails -> IO () # put :: BinHandle -> IfaceIdDetails -> IO (Bin IfaceIdDetails) # get :: BinHandle -> IO IfaceIdDetails #
Binary IfaceUnfolding # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceUnfolding -> IO () # put :: BinHandle -> IfaceUnfolding -> IO (Bin IfaceUnfolding) # get :: BinHandle -> IO IfaceUnfolding #
Binary IfaceInfoItem # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceInfoItem -> IO () # put :: BinHandle -> IfaceInfoItem -> IO (Bin IfaceInfoItem) # get :: BinHandle -> IO IfaceInfoItem #
Binary IfaceIdInfo # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceIdInfo -> IO () # put :: BinHandle -> IfaceIdInfo -> IO (Bin IfaceIdInfo) # get :: BinHandle -> IO IfaceIdInfo #
Binary IfaceCompleteMatch # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceCompleteMatch -> IO () # put :: BinHandle -> IfaceCompleteMatch -> IO (Bin IfaceCompleteMatch) # get :: BinHandle -> IO IfaceCompleteMatch #
Binary IfaceAnnotation # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceAnnotation -> IO () # put :: BinHandle -> IfaceAnnotation -> IO (Bin IfaceAnnotation) # get :: BinHandle -> IO IfaceAnnotation #
Binary IfaceRule # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceRule -> IO () # put :: BinHandle -> IfaceRule -> IO (Bin IfaceRule) # get :: BinHandle -> IO IfaceRule #
Binary IfaceFamInst # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceFamInst -> IO () # put :: BinHandle -> IfaceFamInst -> IO (Bin IfaceFamInst) # get :: BinHandle -> IO IfaceFamInst #
Binary IfaceClsInst # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceClsInst -> IO () # put :: BinHandle -> IfaceClsInst -> IO (Bin IfaceClsInst) # get :: BinHandle -> IO IfaceClsInst #
Binary IfaceSrcBang # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceSrcBang -> IO () # put :: BinHandle -> IfaceSrcBang -> IO (Bin IfaceSrcBang) # get :: BinHandle -> IO IfaceSrcBang #
Binary IfaceBang # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceBang -> IO () # put :: BinHandle -> IfaceBang -> IO (Bin IfaceBang) # get :: BinHandle -> IO IfaceBang #
Binary IfaceConDecl # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceConDecl -> IO () # put :: BinHandle -> IfaceConDecl -> IO (Bin IfaceConDecl) # get :: BinHandle -> IO IfaceConDecl #
Binary IfaceConDecls # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceConDecls -> IO () # put :: BinHandle -> IfaceConDecls -> IO (Bin IfaceConDecls) # get :: BinHandle -> IO IfaceConDecls #
Binary IfaceAxBranch # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceAxBranch -> IO () # put :: BinHandle -> IfaceAxBranch -> IO (Bin IfaceAxBranch) # get :: BinHandle -> IO IfaceAxBranch #
Binary IfaceAT # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceAT -> IO () # put :: BinHandle -> IfaceAT -> IO (Bin IfaceAT) # get :: BinHandle -> IO IfaceAT #
Binary IfaceClassOp # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceClassOp -> IO () # put :: BinHandle -> IfaceClassOp -> IO (Bin IfaceClassOp) # get :: BinHandle -> IO IfaceClassOp #
Binary IfaceFamTyConFlav # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceFamTyConFlav -> IO () # put :: BinHandle -> IfaceFamTyConFlav -> IO (Bin IfaceFamTyConFlav) # get :: BinHandle -> IO IfaceFamTyConFlav #
Binary IfaceTyConParent # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceTyConParent -> IO () # put :: BinHandle -> IfaceTyConParent -> IO (Bin IfaceTyConParent) # get :: BinHandle -> IO IfaceTyConParent #
Binary IfaceDecl # |
Instance details Defined in IfaceSyn Methods put_ :: BinHandle -> IfaceDecl -> IO () # put :: BinHandle -> IfaceDecl -> IO (Bin IfaceDecl) # get :: BinHandle -> IO IfaceDecl #
Binary IfaceTrustInfo # |
Instance details Defined in HscTypes Methods put_ :: BinHandle -> IfaceTrustInfo -> IO () # put :: BinHandle -> IfaceTrustInfo -> IO (Bin IfaceTrustInfo) # get :: BinHandle -> IO IfaceTrustInfo #
Binary Usage # |
Instance details Defined in HscTypes Methods put_ :: BinHandle -> Usage -> IO () # put :: BinHandle -> Usage -> IO (Bin Usage) # get :: BinHandle -> IO Usage #
Binary Dependencies # |
Instance details Defined in HscTypes Methods put_ :: BinHandle -> Dependencies -> IO () # put :: BinHandle -> Dependencies -> IO (Bin Dependencies) # get :: BinHandle -> IO Dependencies #
Binary Warnings # |
Instance details Defined in HscTypes Methods put_ :: BinHandle -> Warnings -> IO () # put :: BinHandle -> Warnings -> IO (Bin Warnings) # get :: BinHandle -> IO Warnings #
Binary ModIface # |
Instance details Defined in HscTypes Methods put_ :: BinHandle -> ModIface -> IO () # put :: BinHandle -> ModIface -> IO (Bin ModIface) # get :: BinHandle -> IO ModIface #
Binary a => Binary [a] # |
Instance details Defined in Binary Methods put_ :: BinHandle -> [a] -> IO () # put :: BinHandle -> [a] -> IO (Bin [a]) # get :: BinHandle -> IO [a] #
Binary a => Binary (Maybe a) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Maybe a -> IO () # put :: BinHandle -> Maybe a -> IO (Bin (Maybe a)) # get :: BinHandle -> IO (Maybe a) #
Binary a => Binary (Ratio a) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Ratio a -> IO () # put :: BinHandle -> Ratio a -> IO (Bin (Ratio a)) # get :: BinHandle -> IO (Ratio a) #
Binary (DefMethSpec IfaceType) # |
Instance details Defined in IfaceType Methods put_ :: BinHandle -> DefMethSpec IfaceType -> IO () # put :: BinHandle -> DefMethSpec IfaceType -> IO (Bin (DefMethSpec IfaceType)) # get :: BinHandle -> IO (DefMethSpec IfaceType) #
Binary a => Binary (BooleanFormula a) # |
Instance details Defined in BooleanFormula Methods put_ :: BinHandle -> BooleanFormula a -> IO () # put :: BinHandle -> BooleanFormula a -> IO (Bin (BooleanFormula a)) # get :: BinHandle -> IO (BooleanFormula a) #
Binary a => Binary (FieldLbl a) # |
Instance details Defined in FieldLabel Methods put_ :: BinHandle -> FieldLbl a -> IO () # put :: BinHandle -> FieldLbl a -> IO (Bin (FieldLbl a)) # get :: BinHandle -> IO (FieldLbl a) #
Binary name => Binary (AnnTarget name) # |
Instance details Defined in Annotations Methods put_ :: BinHandle -> AnnTarget name -> IO () # put :: BinHandle -> AnnTarget name -> IO (Bin (AnnTarget name)) # get :: BinHandle -> IO (AnnTarget name) #
(Binary a, Binary b) => Binary (Either a b) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Either a b -> IO () # put :: BinHandle -> Either a b -> IO (Bin (Either a b)) # get :: BinHandle -> IO (Either a b) #
Typeable a => Binary (TypeRep a) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> TypeRep a -> IO () # put :: BinHandle -> TypeRep a -> IO (Bin (TypeRep a)) # get :: BinHandle -> IO (TypeRep a) #
(Binary a, Binary b) => Binary (a, b) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> (a, b) -> IO () # put :: BinHandle -> (a, b) -> IO (Bin (a, b)) # get :: BinHandle -> IO (a, b) #
Binary a => Binary (GenLocated SrcSpan a) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> GenLocated SrcSpan a -> IO () # put :: BinHandle -> GenLocated SrcSpan a -> IO (Bin (GenLocated SrcSpan a)) # get :: BinHandle -> IO (GenLocated SrcSpan a) #
Binary (Bin a) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> Bin a -> IO () # put :: BinHandle -> Bin a -> IO (Bin (Bin a)) # get :: BinHandle -> IO (Bin a) #
(Binary tv, Binary vis) => Binary (TyVarBndr tv vis) # |
Instance details Defined in Var Methods put_ :: BinHandle -> TyVarBndr tv vis -> IO () # put :: BinHandle -> TyVarBndr tv vis -> IO (Bin (TyVarBndr tv vis)) # get :: BinHandle -> IO (TyVarBndr tv vis) #
(Binary a, Binary b, Binary c) => Binary (a, b, c) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> (a, b, c) -> IO () # put :: BinHandle -> (a, b, c) -> IO (Bin (a, b, c)) # get :: BinHandle -> IO (a, b, c) #
(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 () # put :: BinHandle -> (a, b, c, d) -> IO (Bin (a, b, c, d)) # get :: BinHandle -> IO (a, b, c, d) #
(Binary a, Binary b, Binary c, Binary d, Binary e) => Binary (a, b, c, d, e) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> (a, b, c, d, e) -> IO () # put :: BinHandle -> (a, b, c, d, e) -> IO (Bin (a, b, c, d, e)) # get :: BinHandle -> IO (a, b, c, d, e) #
(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f) => Binary (a, b, c, d, e, f) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> (a, b, c, d, e, f) -> IO () # put :: BinHandle -> (a, b, c, d, e, f) -> IO (Bin (a, b, c, d, e, f)) # get :: BinHandle -> IO (a, b, c, d, e, f) #
(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f, Binary g) => Binary (a, b, c, d, e, f, g) # |
Instance details Defined in Binary Methods put_ :: BinHandle -> (a, b, c, d, e, f, g) -> IO () # put :: BinHandle -> (a, b, c, d, e, f, g) -> IO (Bin (a, b, c, d, e, f, g)) # get :: BinHandle -> IO (a, b, c, d, e, f, g) #

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 #

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

readBinMem :: FilePath -> IO BinHandle #

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

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

# For writing instances

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

getByte :: BinHandle -> IO Word8 #

# Lazy Binary I/O

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

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

# User data

data UserData #

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 #

setUserData :: BinHandle -> UserData -> BinHandle #

newReadState #

Arguments

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

newWriteState #

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

getDictionary :: BinHandle -> IO Dictionary #

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