haddock

Portability | portable
Stability | experimental
Maintainer | haddock@projects.haskell.org
Safe Haskell | Safe-Infered

Haddock.InterfaceFile

Description

Reading and writing the .haddock interface file

Synopsis

- data InterfaceFile = InterfaceFile {
  - ifLinkEnv :: LinkEnv
  - ifInstalledIfaces :: [InstalledInterface]
  }
- ifPackageId :: InterfaceFile -> PackageId
- readInterfaceFile :: forall m. MonadIO m => NameCacheAccessor m -> FilePath -> m (Either String InterfaceFile)
- nameCacheFromGhc :: NameCacheAccessor Ghc
- freshNameCache :: NameCacheAccessor IO
- type NameCacheAccessor m = (m NameCache, NameCache -> m ())
- writeInterfaceFile :: FilePath -> InterfaceFile -> IO ()
- binaryInterfaceVersion :: Word16

# Documentation

data InterfaceFile

Constructors

InterfaceFile |

Fields

ifLinkEnv :: LinkEnv
ifInstalledIfaces :: [InstalledInterface]

Instances

Binary InterfaceFile |

ifPackageId :: InterfaceFile -> PackageId

readInterfaceFile :: forall m. MonadIO m => NameCacheAccessor m -> FilePath -> m (Either String InterfaceFile)

Read a Haddock (`.haddock`) interface file. Return either an `InterfaceFile` or an error message.

This function can be called in two ways. Within a GHC session it will update the use and update the session's name cache. Outside a GHC session a new empty name cache is used. The function is therefore generic in the monad being used. The exact monad is whichever monad the first argument, the getter and setter of the name cache, requires.

nameCacheFromGhc :: NameCacheAccessor Ghc

freshNameCache :: NameCacheAccessor IO

type NameCacheAccessor m = (m NameCache, NameCache -> m ())

writeInterfaceFile :: FilePath -> InterfaceFile -> IO ()

binaryInterfaceVersion :: Word16