[Haddock] Documentation for data family instances

David Waern david.waern at gmail.com
Sun Oct 3 17:50:07 EDT 2010

2010/10/2 C Rodrigues <red5_2 at hotmail.com>:
> I just sent a patch to show data instances in HTML.
> I had to work around the existing infrastructure's assumption that every declaration consists of a top-level name (with
> documentation) and subordinate names (with documentation).  Data families don't follow that rule: they consist of a top-level name
> (the family declaration) with anonymous subordinates (the instances) with subordinate names (data constructors).  I changed
> 'DeclInfo' to allow both structures, which required touching a lot of code mostly in 'Create.hs'.  This seemed like the natural
> thing to do, but I'm not positive it's the right design.
> There's a problem with the current design.  If Haddock can't find the documentation for a data family declaration, it won't show
> documentation for instances or constructors.
> There's also a bug where a data family declaration shows up in multiple modules.  This appears to be a preexisting bug.

Hi Rodrigues,

thanks for the patches! I will take a look at them and the design
issues you raise when I've reviewed some other patches that are in the

I know that data family instances are quite tricky to fit into the
current design, that's why I never implemented them. Thanks for taking
a look at it.


More information about the Haddock mailing list