Ticket #296 (new enhancement)

Opened 9 months ago

Show where instances are coming from

Reported by: nh2 Owned by:
Priority: major Milestone:
Version: 2.13.2.1 Keywords:
Cc: mail@…

Description

Haddock puts orphan instances, in whatever module they may be declared, into the instances list under a data type declaration's documentation.

That can be very confusing, because haddock suggests an instance is available when after importing the module when it is actually only available after importing another module.

Example: http://hackage.haskell.org/package/vect-0.4.7/docs/Data-Vect-Double-Base.html#t:Vec3

Here Haddock suggests instance Eq Vec3, but when loading Data.Vect.Double.Base with GHCI it will complain such instance does not exist. The actual instance is in Data.Vect.Double.Instances (http://hackage.haskell.org/package/vect-0.4.7/docs/Data-Vect-Double-Instances.html), but in contrast to GHCI Haddock looks at instances globally, across the whole package.

It would be great if Haddock could display a link next to orphan instances that make clear from what module the instance comes.

Maybe even better, Haddock could do this for *all* instances, so that we can directly jump to the source like we can for functions.

Note: See TracTickets for help on using tickets.