HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

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.

Contents
  1. Interface
  2. Export items & declarations
  3. Cross-referencing
  4. Instances
  5. Documentation comments
  6. Interface files
  7. Flags and options
  8. Error handling
  9. Program entry point
Synopsis

Interface

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

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

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

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

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

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

Flags and options

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

Program entry point

valuehaddock :: [String] -> IO ()

Run Haddock with given list of arguments.

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

main = getArgs >>= haddock