A docstring with the (probable) identifiers found in it.
Moduleghc-9.10.3GHC2021
GHC.Hs.Doc
Types and functions for raw and lexed docstrings.
- 7 types
- 5 values
- Packageghc-9.10.3
- Exports12
- LanguageGHC2021
- LicenceBSD-3-Clause
- SourceDoc.hs
Annotate a value with the probable identifiers found in it These will be used by haddock to generate links.
The identifiers are bundled along with their location in the source file. This is useful for tooling to know exactly where they originate.
This type is currently used in two places - for regular documentation comments,
with a set to HsDocString, and for adding identifier information to
warnings, where a is StringLiteral
Constructors
WithHsDocIdentifiershsDocString :: !ahsDocIdentifiers :: ![Located (IdP pass)]
Instances6ToHie, Eq, Data, NFData, Outputable, Binary
ToHie (LHsDoc GhcRn)Defined in ghc-9.10.3 · GHC.Iface.Ext.Ast(Eq (IdP pass), Eq a) => Eq (WithHsDocIdentifiers a pass)Defined in ghc-9.10.3 · GHC.Hs.Doc(Data pass, Data (IdP pass), Data a) => Data (WithHsDocIdentifiers a pass)Defined in ghc-9.10.3 · GHC.Hs.Doc(NFData (IdP pass), NFData a) => NFData (WithHsDocIdentifiers a pass)Defined in ghc-9.10.3 · GHC.Hs.DocOutputable a => Outputable (WithHsDocIdentifiers a pass)Defined in ghc-9.10.3 · GHC.Hs.DocFor compatibility with the existing @-ddump-parsed' output, we only show the docstring.
Use
pprHsDocto show HsDoc's internals.Binary a => Binary (WithHsDocIdentifiers a GhcRn)Defined in ghc-9.10.3 · GHC.Hs.Doc
Extract a mapping from the lexed identifiers to the names they may correspond to.
Print a doc with its identifiers, useful for debugging
Pretty print a thing with its doc The docstring will include the comment decorators '-- |', '{-|' etc and will come either before or after depending on how it was written i.e it will come after the thing if it is a '-- ^' or '{-^' and before otherwise.
See pprWithHsDoc
module GHC.Hs.DocString
Maps of docs that were added via Template Haskell's putDoc.
Constructors
ExtractedTHDocsethd_mod_header :: Maybe (HsDoc GhcRn)The added module header documentation, if it exists.
ethd_decl_docs :: UniqMap Name (HsDoc GhcRn)The documentation added to declarations.
ethd_arg_docs :: UniqMap Name (IntMap (HsDoc GhcRn))The documentation added to function arguments.
ethd_inst_docs :: UniqMap Name (HsDoc GhcRn)The documentation added to class and family instances.
A simplified version of HsImpExp.IE.
Constructors
Instances3NFData, Outputable, Binary
NFData DocStructureItemDefined in ghc-9.10.3 · GHC.Hs.DocOutputable DocStructureItemDefined in ghc-9.10.3 · GHC.Hs.DocBinary DocStructureItemDefined in ghc-9.10.3 · GHC.Hs.Doc
Constructors
Docsdocs_mod_hdr :: Maybe (HsDoc GhcRn)Module header.
docs_exports :: UniqMap Name (HsDoc GhcRn)Docs attached to module exports.
docs_decls :: UniqMap Name [HsDoc GhcRn]Docs for declarations: functions, data types, instances, methods etc. A list because sometimes subsequent haddock comments can be combined into one
docs_args :: UniqMap Name (IntMap (HsDoc GhcRn))Docs for arguments. E.g. function arguments, method arguments.
docs_structure :: DocStructuredocs_named_chunks :: Map String (HsDoc GhcRn)Map from chunk name to content.
This map will be empty unless we have an explicit export list from which we can reference the chunks.
docs_haddock_opts :: Maybe StringHaddock options from
OPTIONS_HADDOCKor from-haddock-opts.docs_language :: Maybe LanguageThe Language used in the module, for example Haskell2010.
docs_extensions :: EnumSet ExtensionThe full set of language extensions used in the module.