haddockSource codeContentsIndex
Haddock.Types
Synopsis
data DocOption
= OptHide
| OptPrune
| OptIgnoreExports
| OptNotHome
data ExportItem name
= ExportDecl {
expItemName :: Name
expItemDecl :: LHsDecl name
expItemMbDoc :: Maybe (HsDoc name)
expItemInstances :: [InstHead name]
}
| ExportNoDecl {
expItemName :: Name
expItemLinkTarget :: name
expItemSubs :: [name]
}
| ExportGroup {
expItemSectionLevel :: Int
expItemSectionId :: String
expItemSectionText :: HsDoc name
}
| ExportDoc (HsDoc name)
| ExportModule Module
type InstHead name = ([HsPred name], name, [HsType name])
type ModuleMap = Map Module Interface
type DocMap = Map Name (HsDoc DocName)
type LinkEnv = Map Name Module
data GhcModule = GhcModule {
ghcModule :: Module
ghcFilename :: FilePath
ghcMbDocOpts :: Maybe String
ghcHaddockModInfo :: HaddockModInfo Name
ghcMbDoc :: Maybe (HsDoc Name)
ghcGroup :: HsGroup Name
ghcMbExports :: Maybe [LIE Name]
ghcExportedNames :: [Name]
ghcNamesInScope :: [Name]
ghcInstances :: [Instance]
}
data Interface = Interface {
ifaceMod :: Module
ifaceOrigFilename :: FilePath
ifaceInfo :: HaddockModInfo Name
ifaceDoc :: Maybe (HsDoc Name)
ifaceRnDoc :: Maybe (HsDoc DocName)
ifaceOptions :: [DocOption]
ifaceExportedDeclMap :: Map Name (LHsDecl Name)
ifaceDocMap :: Map Name (HsDoc Name)
ifaceRnDocMap :: Map Name (HsDoc DocName)
ifaceExportItems :: [ExportItem Name]
ifaceRnExportItems :: [ExportItem DocName]
ifaceEnv :: Map OccName Name
ifaceLocals :: [Name]
ifaceExports :: [Name]
ifaceVisibleExports :: [Name]
ifaceSubMap :: Map Name [Name]
ifaceInstances :: [Instance]
}
data InstalledInterface = InstalledInterface {
instMod :: Module
instInfo :: HaddockModInfo Name
instDocMap :: Map Name (HsDoc DocName)
instExports :: [Name]
instVisibleExports :: [Name]
}
toInstalledIface :: Interface -> InstalledInterface
data DocMarkup id a = Markup {
markupEmpty :: a
markupString :: String -> a
markupParagraph :: a -> a
markupAppend :: a -> a -> a
markupIdentifier :: [id] -> a
markupModule :: String -> a
markupEmphasis :: a -> a
markupMonospaced :: a -> a
markupUnorderedList :: [a] -> a
markupOrderedList :: [a] -> a
markupDefList :: [(a, a)] -> a
markupCodeBlock :: a -> a
markupURL :: String -> a
markupAName :: String -> a
}
type ErrMsg = String
newtype ErrMsgM a = Writer {
runWriter :: (a, [ErrMsg])
}
tell :: [ErrMsg] -> ErrMsgM ()
Documentation
data DocOption Source
Constructors
OptHideThis module should not appear in the docs
OptPrune
OptIgnoreExportsPretend everything is exported
OptNotHomeNot the best place to get docs for things exported by this module.
show/hide Instances
data ExportItem name Source
Constructors
ExportDeclAn exported declaration
expItemName :: NameThe original name
expItemDecl :: LHsDecl nameA declaration
expItemMbDoc :: Maybe (HsDoc name)Maybe a doc comment
expItemInstances :: [InstHead name]Instances relevant to this declaration
ExportNoDeclAn exported entity for which we have no documentation (perhaps because it resides in another package)
expItemName :: NameThe original name
expItemLinkTarget :: nameWhere to link to
expItemSubs :: [name]Subordinate names
ExportGroupA section heading
expItemSectionLevel :: IntSection level (1, 2, 3, ... )
expItemSectionId :: StringSection id (for hyperlinks)
expItemSectionText :: HsDoc nameSection heading text
ExportDoc (HsDoc name)Some documentation
ExportModule ModuleA cross-reference to another module
type InstHead name = ([HsPred name], name, [HsType name])Source
type ModuleMap = Map Module InterfaceSource
type DocMap = Map Name (HsDoc DocName)Source
type LinkEnv = Map Name ModuleSource
data GhcModule Source
This structure holds the module information we get from GHC's type checking phase
Constructors
GhcModule
ghcModule :: Module
ghcFilename :: FilePath
ghcMbDocOpts :: Maybe String
ghcHaddockModInfo :: HaddockModInfo Name
ghcMbDoc :: Maybe (HsDoc Name)
ghcGroup :: HsGroup Name
ghcMbExports :: Maybe [LIE Name]
ghcExportedNames :: [Name]
ghcNamesInScope :: [Name]
ghcInstances :: [Instance]
data Interface Source
This is the data structure used to render a Haddock page for a module - it is the interface of the module. The core of Haddock lies in creating this structure (see Haddock.Interface). The structure also holds intermediate data needed during its creation.
Constructors
Interface
ifaceMod :: ModuleThe documented module
ifaceOrigFilename :: FilePathThe original filename for this module
ifaceInfo :: HaddockModInfo NameTextual information about the module
ifaceDoc :: Maybe (HsDoc Name)The documentation header for this module
ifaceRnDoc :: Maybe (HsDoc DocName)The renamed documentation header for this module
ifaceOptions :: [DocOption]The Haddock options for this module (prune, ignore-exports, etc)
ifaceExportedDeclMap :: Map Name (LHsDecl Name)
ifaceDocMap :: Map Name (HsDoc Name)
ifaceRnDocMap :: Map Name (HsDoc DocName)
ifaceExportItems :: [ExportItem Name]
ifaceRnExportItems :: [ExportItem DocName]
ifaceEnv :: Map OccName NameEnvironment mapping exported names to *original* names
ifaceLocals :: [Name]All the names that are defined in this module
ifaceExports :: [Name]All the names that are exported by this module
ifaceVisibleExports :: [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.
ifaceSubMap :: Map Name [Name]
ifaceInstances :: [Instance]The instances exported by this module
data InstalledInterface Source
A smaller version of Interface that we can get from the Haddock interface files.
Constructors
InstalledInterface
instMod :: Module
instInfo :: HaddockModInfo Name
instDocMap :: Map Name (HsDoc DocName)
instExports :: [Name]
instVisibleExports :: [Name]
show/hide Instances
toInstalledIface :: Interface -> InstalledInterfaceSource
Convert an Interface to an InstalledInterface
data DocMarkup id a Source
Constructors
Markup
markupEmpty :: a
markupString :: String -> a
markupParagraph :: a -> a
markupAppend :: a -> a -> a
markupIdentifier :: [id] -> a
markupModule :: String -> a
markupEmphasis :: a -> a
markupMonospaced :: a -> a
markupUnorderedList :: [a] -> a
markupOrderedList :: [a] -> a
markupDefList :: [(a, a)] -> a
markupCodeBlock :: a -> a
markupURL :: String -> a
markupAName :: String -> a
type ErrMsg = StringSource
newtype ErrMsgM a Source
Constructors
Writer
runWriter :: (a, [ErrMsg])
show/hide Instances
Monad ErrMsgM
tell :: [ErrMsg] -> ErrMsgM ()Source
Produced by Haddock version 2.1.0