Moduleghc-9.10.3GHC2021
GHC.Hs.DocString
An exactprintable structure for docstrings
- 5 types
- 13 values
- Packageghc-9.10.3
- Exports18
- LanguageGHC2021
- LicenceBSD-3-Clause
- SourceDocString.hs
Haskell Documentation String
Rich structure to support exact printing The location around each chunk doesn't include the decorators
Constructors
MultiLineDocString !HsDocStringDecorator !(NonEmpty LHsDocStringChunk)The first chunk is preceded by "-- decorator" and each following chunk is preceded by "--" Example: -- | This is a docstring for
foo. It is the line with the decorator|and is always included -- This continues that docstring and is the second element in the NonEmpty list foo :: a -> aNestedDocString !HsDocStringDecorator LHsDocStringChunkThe docstring is preceded by "{-decorator" and followed by "-}" The chunk contains balanced pairs of '{-' and '-}'
GeneratedDocString HsDocStringChunkA docstring generated either internally or via TH Pretty printed with the '-- |' decorator This is because it may contain unbalanced pairs of '{-' and '-}' and not form a valid NestedDocString
Instances7Eq, Data, Show, NFData, Outputable, Binary, …
Eq HsDocStringDefined in ghc-9.10.3 · GHC.Hs.DocStringData HsDocStringDefined in ghc-9.10.3 · GHC.Hs.DocStringShow HsDocStringDefined in ghc-9.10.3 · GHC.Hs.DocStringNFData HsDocStringDefined in ghc-9.10.3 · GHC.Hs.DocStringOutputable HsDocStringDefined in ghc-9.10.3 · GHC.Hs.DocStringBinary HsDocStringDefined in ghc-9.10.3 · GHC.Hs.DocStringToHie (LHsDoc GhcRn)Defined in ghc-9.10.3 · GHC.Iface.Ext.Ast
Constructors
HsDocStringNext|is the decoratorHsDocStringPrevious^ is the decorator
HsDocStringNamed !String'$string' is the decorator
HsDocStringGroup !IntThe decorator is the given number of *s
Instances7Eq, Data, Ord, Show, NFData, Outputable, …
Eq HsDocStringDecoratorDefined in ghc-9.10.3 · GHC.Hs.DocStringData HsDocStringDecoratorDefined in ghc-9.10.3 · GHC.Hs.DocStringOrd HsDocStringDecoratorDefined in ghc-9.10.3 · GHC.Hs.DocStringShow HsDocStringDecoratorDefined in ghc-9.10.3 · GHC.Hs.DocStringNFData HsDocStringDecoratorDefined in ghc-9.10.3 · GHC.Hs.DocStringOutputable HsDocStringDecoratorDefined in ghc-9.10.3 · GHC.Hs.DocStringBinary HsDocStringDecoratorDefined in ghc-9.10.3 · GHC.Hs.DocString
A contiguous chunk of documentation
Constructors
Instances7Eq, Data, Ord, Show, NFData, Outputable, …
Eq HsDocStringChunkDefined in ghc-9.10.3 · GHC.Hs.DocStringData HsDocStringChunkDefined in ghc-9.10.3 · GHC.Hs.DocStringOrd HsDocStringChunkDefined in ghc-9.10.3 · GHC.Hs.DocStringShow HsDocStringChunkDefined in ghc-9.10.3 · GHC.Hs.DocStringNFData HsDocStringChunkDefined in ghc-9.10.3 · GHC.Hs.DocStringOutputable HsDocStringChunkDefined in ghc-9.10.3 · GHC.Hs.DocStringBinary HsDocStringChunkDefined in ghc-9.10.3 · GHC.Hs.DocString
Create a HsDocString from a UTF8-encoded ByteString.
Pretty print with decorators, exactly as the user wrote it
Just get the docstring, without any decorators
Just get the docstring, without any decorators Separates docstrings using "nn", which is how haddock likes to render them
Pretty print with decorators, exactly as the user wrote it
Annotate a pretty printed thing with its doc The docstring comes after if is HsDocStringPrevious Otherwise it comes before. Note - we convert MultiLineDocString HsDocStringPrevious to HsDocStringNext because we can't control if something else will be pretty printed on the same line