#3097: Parser doesn't support doc comments on type aliases
-----------------------------+----------------------------------------------
Reporter: waern | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 6.11 | Severity: major
Keywords: Haddock | Testcase:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
-----------------------------+----------------------------------------------
I want to add comments to type synonyms in order to fix the following
Haddock bug, but I need some help.
http://trac.haskell.org/haddock/ticket/9
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
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3097>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs