Ticket #296 (new enhancement)
Opened 5 months ago
Show where instances are coming from
|Reported by:||nh2||Owned by:|
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.
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.