[Haskell] A haddock question
simonmar at microsoft.com
Mon Oct 10 08:02:18 EDT 2005
On 10 October 2005 12:44, Benjamin Franksen wrote:
> I have a module with a public class plus some instances for public
> data types. In addition, I use this class inside another module where
> I declare local (module private) data types and make them instances of
> the class. I had expected that haddock (I am using 0.7) will list in
> the documentation only instances of data types that are exported, but
> instead all instances are listed.
> Is there a way to persuade haddock to list only instances of data
> types that are actually visible to the user?
Haddock's support for instances is somewhat braindead - it just reports
all the instances it can find for a given class in the entire set of
modules it is processing. In particular, Haddock makes no attempt to
tell you how to bring these instances into scope: they might not be
available from the module that exports the class, or the type(s),
involved in the instance.
Haskell makes this quite hard: an instance is available if it is
provided by the transitive closure of an imported module. We clearly
don't want to report all the available instances in every module's
documentation, however. This is exposes to the user
More information about the Haskell