haddock-2.6.0: A documentation-generation tool for Haskell librariesSource codeContentsIndex
Distribution.Haddock
Synopsis
readInterfaceFile :: MonadIO m => NameCacheAccessor m -> FilePath -> m (Either String InterfaceFile)
nameCacheFromGhc :: NameCacheAccessor Ghc
freshNameCache :: NameCacheAccessor IO
type NameCacheAccessor m = (m NameCache, NameCache -> m ())
data InterfaceFile = InterfaceFile {
ifLinkEnv :: LinkEnv
ifInstalledIfaces :: [InstalledInterface]
}
type LinkEnv = Map Name Module
data InstalledInterface = InstalledInterface {
instMod :: Module
instInfo :: HaddockModInfo Name
instDocMap :: Map Name (DocForDecl Name)
instExports :: [Name]
instVisibleExports :: [Name]
instOptions :: [DocOption]
instSubMap :: Map Name [Name]
}
data DocName
= Documented Name Module
| Undocumented Name
docNameOcc :: DocName -> OccName
Documentation
readInterfaceFile :: MonadIO m => NameCacheAccessor m -> FilePath -> m (Either String InterfaceFile)Source

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 GhcSource
freshNameCache :: NameCacheAccessor IOSource
type NameCacheAccessor m = (m NameCache, NameCache -> m ())Source
data InterfaceFile Source
Constructors
InterfaceFile
ifLinkEnv :: LinkEnv
ifInstalledIfaces :: [InstalledInterface]
show/hide Instances
type LinkEnv = Map Name ModuleSource
data InstalledInterface Source
A smaller version of Interface that we can get from the Haddock interface files.
Constructors
InstalledInterface
instMod :: ModuleThe module represented by this interface
instInfo :: HaddockModInfo NameTextual information about the module
instDocMap :: Map Name (DocForDecl Name)Everything declared in the module (including subordinates) that has docs
instExports :: [Name]All names exported by this module
instVisibleExports :: [Name]

All the visible names exported by this module For a name to be visible, it has to:

  • be exported normally, and not via a full module re-exportation.
  • have a declaration in this module or any of it's imports, with the exception that it can't be from another package.

Basically, a visible name is a name that will show up in the documentation for this module.

instOptions :: [DocOption]The Haddock options for this module (prune, ignore-exports, etc)
instSubMap :: Map Name [Name]
show/hide Instances
data DocName Source
A DocName is an identifier that may be documented. The Module component specifies the place which we want to link to in the documentation.
Constructors
Documented Name Module
Undocumented Name
show/hide Instances
docNameOcc :: DocName -> OccNameSource
The OccName belonging to this name
Produced by Haddock version 2.6.0