HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-9.10.3GHC2021

GHC.HsToCore.Docs

Extract docs from the renamer output so they can be serialized.

  • 30 values
  • Packageghc-9.10.3
  • Exports30
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceDocs.hs
valueextractDocs
  1. :: MonadIO m
  2. => DynFlags
  3. -> TcGblEnv
  4. -> m (Maybe Docs)
    1. Module header

    2. Docs on top level declarations

    3. Docs on arguments

#

Extract docs from renamer output. This is monadic since we need to be able to read documentation added from Template Haskell's putDoc, which is stored in tcg_th_docs.

Maybe remove items that export nothing?

0 declarations

Combine sequences of DsiExports?

0 declarations

Check the ordering of avails in DsiModExport

27 declarations
valuegetNamedChunks
  1. :: Bool

    Do we have an explicit export list?

  2. -> HsGroup (GhcPass pass)
  3. -> Map String (HsDoc (GhcPass pass))
#

Extract named documentation chunks from the renamed declarations.

If there is no explicit export list, we simply return an empty map since there would be no way to link to a named chunk.

valuesigNameNoLoc
  1. :: (UnXRec a, HasOccName (IdP a))
  2. => OccEnv (IdP a)
  3. -> Sig a
  4. -> [IdP a]
#

The "OccEnv Name" is the default method environment for this module Ultimately, the a special "defaultMethodOcc" name is used for the signatures on bindings for default methods. Unfortunately, this name isn't generated until typechecking, so it is not in the renamed AST. We have to look it up from the OccEnv parameter constructed from the typechecked AST. See also Note [default method Name] in GHC.Iface.Recomp

valuecollectDocs :: UnXRec p => [LHsDecl p] -> [(LHsDecl p, [HsDoc p])]
#

Collect docs and attach them to the right declarations.

A declaration may have multiple doc strings attached to it.

This is an example.

valuemkDecls
  1. :: struct -> [GenLocated l decl]
  2. -> decl -> hsDecl
  3. -> struct
  4. -> [GenLocated l hsDecl]
#

Take a field of declarations from a data structure and create HsDecls using the given constructor