Parser doesn't support doc comments on type aliases
I want to add comments to type synonyms in order to fix the following Haddock bug, but I need some help.
In the parser, the rule for type synonyms is:
'type' type '=' ctype
Types with comments are already defined as ctypedoc
and used for top-level types.
So it is tempting to just change ctype
in the above line to ctypedoc
. Indeed, I think originally ctypedoc
was defined exactly as ctype
, modulo comments. However, since then ctype
has changed.
The differences are:
-
ctype
disallows foralls/contexts after a contex implication (=>). -
ctype
allows implicit parameters outside contexts. Seems to be disallowed by GHC later (after parsing). -
ctype
allows type equalities (~) outside contexts. Seems to be disallowed later also.
I haven't seen any further differences (besides comments).
Can I just change type synonyms to use ctypedoc
without any other changes? Or do we need the features of ctype
there? If so, then changing ctypedoc
into just a commented version of ctype
would not work as a solution, since then syntax like this (from base:GHC/Desugar.hs) breaks:
(>>>) :: forall arr. Arrow arr => forall a b c. arr a b -> arr b c -> arr a c
Trac metadata
Trac field | Value |
---|---|
Version | 6.11 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |