[Haskell-cafe] Re: Haddock: Documentation of instances with un-documentable type arguments

Johannes Waldmann waldmann at imn.htwk-leipzig.de
Sat Aug 28 07:52:45 EDT 2010

> in terms of how you could use it, that would
> be equivalent to also exporting Secret [...]

well, expect that you cannot use the type's name in signatures,
so you'd have to rely on type inference.

Out of curiosity I just checked javadoc's behaviour on

public class Ex {
    public interface Show { }
    static private class Secret implements Show { }
    public Secret foo () { return new Secret (); }
    static public class Known implements Show { }
    public Known bar () { return new Known (); }

and it does generate documentation for all the public identifiers,
with a non-linked result type for "foo",
and it does not list "Secret" among the "known instances" for Show.

Well, then I checked haddock (2.7.2) for

module Ex ( foo, bar, Known ) where
data Secret = Secret
foo = Secret
instance Show Secret
data Known = Known
bar = Known
instance Show Known

and it behaves identically (does not mention Secret as a known instance).

So, is this the behaviour that the original poster wanted?


More information about the Haskell-Cafe mailing list