ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Iface.Ext.Binary

Synopsis

- readHieFile :: NameCache -> FilePath -> IO HieFileResult
- readHieFileWithVersion :: (HieHeader -> Bool) -> NameCache -> FilePath -> IO (Either HieHeader HieFileResult)
- type HieHeader = (Integer, ByteString)
- writeHieFile :: FilePath -> HieFile -> IO ()
- data HieName
  - = ExternalName !Module !OccName !SrcSpan
  - | LocalName !OccName !SrcSpan
  - | KnownKeyName !Unique
- toHieName :: Name -> HieName
- data HieFileResult = HieFileResult {
  - hie_file_result_version :: Integer
  - hie_file_result_ghc_version :: ByteString
  - hie_file_result :: HieFile
  }
- hieMagic :: [Word8]
- hieNameOcc :: HieName -> OccName

# Documentation

readHieFile :: NameCache -> FilePath -> IO HieFileResult Source #

Read a `HieFile` from a `FilePath`. Can use an existing `NameCache`.

readHieFileWithVersion :: (HieHeader -> Bool) -> NameCache -> FilePath -> IO (Either HieHeader HieFileResult) Source #

Read a `HieFile` from a `FilePath`. Can use an existing `NameCache`. Allows you to specify which versions of hieFile to attempt to read. `Left` case returns the failing header versions.

type HieHeader = (Integer, ByteString) Source #

writeHieFile :: FilePath -> HieFile -> IO () Source #

Write a `HieFile` to the given `FilePath`, with a proper header and symbol tables for `Name`s and `FastString`s

data HieName Source #

`Name`'s get converted into `HieName`'s before being written into `.hie` files. See `toHieName` and `fromHieName` for logic on how to convert between these two types.

Constructors

ExternalName !Module !OccName !SrcSpan |
LocalName !OccName !SrcSpan |
KnownKeyName !Unique |

#### Instances

Instances details

Outputable HieName Source # |
Instance details Defined in GHC.Iface.Ext.Types Methods ppr :: HieName -> SDoc Source #
Eq HieName Source # |
Instance details Defined in GHC.Iface.Ext.Types Methods (==) :: HieName -> HieName -> Bool # (/=) :: HieName -> HieName -> Bool #
Ord HieName Source # |
Instance details Defined in GHC.Iface.Ext.Types Methods compare :: HieName -> HieName -> Ordering # (<) :: HieName -> HieName -> Bool # (<=) :: HieName -> HieName -> Bool # (>) :: HieName -> HieName -> Bool # (>=) :: HieName -> HieName -> Bool # max :: HieName -> HieName -> HieName # min :: HieName -> HieName -> HieName #

toHieName :: Name -> HieName Source #

data HieFileResult Source #

Constructors

HieFileResult |

Fields

- hie_file_result_version :: Integer
- hie_file_result_ghc_version :: ByteString
- hie_file_result :: HieFile

hieMagic :: [Word8] Source #

The header for HIE files - Capital ASCII letters "HIE".

hieNameOcc :: HieName -> OccName Source #