Fellow GHC devs
I’d like to ask your help with reviewing a GHC patch
!2377:
Accumulate Haddock comments in P (#17544, #17561, #8944)
It’s a substantial patch to the parser, changing the way in which Haddock documentation is parsed. It moves us in a good direction; it makes us more robust for the future; Vlad has invested a lot of effort in it; and I’m sure we should land it.
But it’s had surprisingly little review, especially for a patch that potentially affects quite a lot of people (incl Haddock folk, IDE folk).
So, would any of you be willing to review the code itself? Especially folk involved in Haddock or Haskell IDE. Early versions were not easy to understand, but Vlad has invested a lot of effort in both simplifying it and in documenting it.
We’ll land it regardless in a couple of weeks.
Thanks!
Simon
Summary of the payload (taken from #17544)
Currently Haddock comments are, first and foremost, comments. It's very annoying to incorporate them into the grammar. We can take advantage of an important property: adding a Haddock comment does not change the parse tree in any way other than wrapping
some nodes in HsDocTy and the like (and if it does, that's a bug).
Here's the design I propose instead:
This means
A detailed overview of the implementation plan is in comments at the start of
compiler/GHC/Parser/PostProcess/Haddock.hs