haddock
haddock copied to clipboard
Nested block comments are elided
For example, in these haddocks, the following bit within a haddock {-|--}-comment,
For example,
> { {- A -} x {- B -} : {- C -} T }
... or
> { {- A -} x {- B -} = {- C -} T }
will be instantiated as follows:
…is rendered like this:
For example,
{ x : T } ... or
{ x = T }
The nested block comments like {- A -} and {- B -} are missing.
As a workaround, one can use line comment syntax (--|) to ensure that internal block comments are preserved. (See https://github.com/dhall-lang/dhall-haskell/pull/2098 for an example.)
I found that this also concerns pragmas, e.g.
{-| ...
> {-# FOREIGN GHC import Prelude (Char, Double, Integer, String) #-}
> {-# FOREIGN GHC import qualified Data.Text #-}
> {-# FOREIGN GHC import qualified CPP.Abs #-}
> {-# FOREIGN GHC import CPP.Print (printTree) #-}
>
> data Ident : Set where
> ident : #String → Ident
-}
just drops all the pragmas in the rendering (apologies for the Agda syntax...).
https://gitlab.haskell.org/ghc/ghc/-/issues/20336 is related.