HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Modulehaddock-api-2.34.0Haskell2010

Documentation.Haddock

The Haddock API: A rudimentary, highly experimental API exposing some of the internals of Haddock. Don't expect it to be stable.

  • 25 types
  • 10 values

Interface

5 declarations
datadata Interface
#

Interface holds all information used to render a single Haddock page. It represents the interface of a module. The core business of Haddock lies in creating this structure. Note that the record contains some fields that are only used to create the final record, and that are not used by the backends.

Constructors

datadata InstalledInterface
#

A subset of the fields of Interface that we store in the interface files.

Constructors

Instances1Binary
valuecreateInterfaces
  1. :: [Flag]

    A list of command-line flags

  2. -> [String]

    File or module names

  3. -> IO [Interface]

    Resulting list of interfaces

#

Create Interface structures from a given list of Haddock command-line flags and file or module names (as accepted by haddock executable). Flags that control documentation generation or show help or version information are ignored.

valueprocessModules
  1. :: Verbosity

    Verbosity of logging to stdout

  2. -> [String]

    A list of file or module names sorted by module topology

  3. -> [Flag]

    Command-line flags

  4. -> [InterfaceFile]

    Interface files of package dependencies

  5. -> Ghc ([Interface], LinkEnv)

    Resulting list of interfaces and renaming environment

#

Create Interfaces and a link environment by typechecking the list of modules using the GHC API and processing the resulting syntax trees.

Export items & declarations

3 declarations
datadata ExportItem name
#

Constructors

typetype FnArgsDoc name = Map Int (MDoc name)
#

Arguments and result are indexed by Int, zero-based from the left, because that's the easiest to use when recursing over types.

Cross-referencing

2 declarations
typetype LinkEnv = Map Name Module
#

Type of environment used to cross-reference identifiers in the syntax.

datadata DocName
#

Extends Name with cross-reference information.

Constructors

  • Documented Name Module

    This thing is part of the (existing or resulting) documentation. The Module is the preferred place in the documentation to refer to.

  • Undocumented Name

    This thing is not part of the (existing or resulting) documentation, as far as Haddock knows.

Instances9Eq, Data, NamedThing, Outputable, Binary, OutputableBndr, …

Instances

2 declarations
datadata InstHead name
#

The head of an instance. Consists of a class name, a list of type parameters (which may be annotated with kinds), and an instance type

Documentation comments

13 declarations
datadata DocH mod id
#

Constructors

Instances10Bifoldable, Bifunctor, Bitraversable, Functor, Foldable, Traversable, …
  • Bifoldable DocHDefined in haddock-library-1.11.0 · Documentation.Haddock.Types
  • Bifunctor DocHDefined in haddock-library-1.11.0 · Documentation.Haddock.Types
  • Bitraversable DocHDefined in haddock-library-1.11.0 · Documentation.Haddock.Types
  • Functor (DocH mod)Defined in haddock-library-1.11.0 · Documentation.Haddock.Types
  • Foldable (DocH mod)Defined in haddock-library-1.11.0 · Documentation.Haddock.Types
  • Traversable (DocH mod)Defined in haddock-library-1.11.0 · Documentation.Haddock.Types
  • (Eq id, Eq mod) => Eq (DocH mod id)Defined in haddock-library-1.11.0 · Documentation.Haddock.Types
  • (Show id, Show mod) => Show (DocH mod id)Defined in haddock-library-1.11.0 · Documentation.Haddock.Types
  • (NFData a, NFData mod) => NFData (DocH mod a)Defined in haddock-api-2.34.0 · Haddock.Types · orphan
  • (Binary mod, Binary id) => Binary (DocH mod id)Defined in haddock-api-2.34.0 · Haddock.InterfaceFile · orphan
datadata DocMarkupH mod id a
#

DocMarkupH is a set of instructions for marking up documentation. In fact, it's really just a mapping from Doc to some other type [a], where [a] is usually the type of the output (HTML, say). Use markup to apply a DocMarkupH to a DocH.

datadata HaddockModInfo name
#
Instances2NFData, Binary

Interface files

3 declarations
valuereadInterfaceFile
  1. :: NameCache
  2. -> FilePath
  3. -> Bool

    Disable version check. Can cause runtime crash.

  4. -> IO (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.

Flags and options

2 declarations
datadata Flag
#
Instances2Eq, Show
  • Eq FlagDefined in haddock-api-2.34.0 · Haddock.Options
  • Show FlagDefined in haddock-api-2.34.0 · Haddock.Options
datadata DocOption
#

Source-level options for controlling the documentation.

Constructors

Instances3Eq, Show, Binary
  • Eq DocOptionDefined in haddock-api-2.34.0 · Haddock.Types
  • Show DocOptionDefined in haddock-api-2.34.0 · Haddock.Types
  • Binary DocOptionDefined in haddock-api-2.34.0 · Haddock.InterfaceFile · orphan

Error handling

1 declaration

Program entry point

4 declarations
valuehaddock :: [String] -> IO ()
#

Run Haddock with given list of arguments.

Haddock's own main function is defined in terms of this:

main = getArgs >>= haddock