[Haskell-cafe] Re: Haddock: Documentation of instances with
un-documentable type arguments
illissius at gmail.com
Sat Aug 28 07:53:20 EDT 2010
On Sat, Aug 28, 2010 at 1:41 PM, Ivan Lazar Miljenovic
<ivan.miljenovic at gmail.com> wrote:
> On 28 August 2010 21:33, Johannes Waldmann <waldmann at imn.htwk-leipzig.de> wrote:
>>> > Perhaps Haddock could exclude class instance reporting when it cannot find a
>>> > documentable link to a parameter?
>> The "cannot find documentable link" problem also comes up
>> in situations like this (that don't involve type classes):
>> module Ex ( foo ) where
>> data Secret = Secret
>> foo = Secret
>> Should haddock generate documentation
>> for foo (since it is exported)
>> or not (since its result type is not exported)?
> The more important question is "why doesn't it have a type signature?" :p
> How does GHC deal with that kind of situation? Off the top of my
> head, I would think that in terms of how you could use it, that would
> be equivalent to also exporting Secret (the type, not the
> constructor); i.e. "module Ex (Secret, foo) where ...".
I tried this once, because I was wondering the same thing. Basically
it works the way I expected: if you export functions which have a
given type in their signature, but the type is not exported, you can
use the functions and combine them however you want, but you can't
explicitly mention or use the unexported type anywhere. At the time I
actually had a use case in mind for why this would be useful, but I
can't remember what it was.
> Ivan Lazar Miljenovic
> Ivan.Miljenovic at gmail.com
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
Work is punishment for failing to procrastinate effectively.
More information about the Haskell-Cafe