Haddock GADTs Hack
Ashley Yakeley <ashley <at> semantic.org>
2007-02-07 07:17:59 GMT
Included is a hack to allow haddock to parse GADTs. There are two
problems with it:
1. I don't think you can add doc comments to the constructors.
2. The shown types are wrong: the whole type of the constructor is shown
as if it were the type of a single argument. Fixing this will presumably
involve adding another constructor to HsConDecl to represent GADT
constructors.
It wouldn't be appropriate to release haddock in this state, but I think
it's helpful for those of us who could get no doc at all just because we
have a GADT in our code.
--
--
Ashley Yakeley
Seattle, WA
New patches:
[hack to parse GADTs, though with incorrect constructor types
Ashley Yakeley <ashley <at> semantic.org>**20070207070109] {
hunk ./src/HsParser.ly 480
+> | 'where' gadtconstrlist { addConDocs $2 Nothing }
hunk ./src/HsParser.ly 497
+> gadtconstrlist :: { [HsConDecl] }
+> : '{' gadtconstrs '}' { $2 }
+> | layout_on gadtconstrs close { $2 }
(Continue reading)