haddock icon indicating copy to clipboard operation
haddock copied to clipboard

Named chunks in module header

Open sgraf812 opened this issue 7 years ago • 2 comments

Apparently, haddock (or the parser, rather) doesn't allow named chunk references in the module header:

-- |
-- $doc
module Foo where

-- $doc
-- foo
Foo.hs:2:1: error: parse error on input ‘-- $doc’
  |
2 | -- $doc
  | ^^^^^^^

sgraf812 avatar Nov 09 '18 09:11 sgraf812

As is usually the case here, the problem is in GHC's moduleheader production. We could tweak this to also accept

-- $doc
module Foo where

-- $doc
-- foo

The main concern is that chunk references have to be tokens on their own. All of this will become much simpler once I finish https://phabricator.haskell.org/D5057.

harpocrates avatar Nov 09 '18 15:11 harpocrates

I guess named chunks in module header didn't happen yet ?

simonmichael avatar Nov 04 '23 10:11 simonmichael