[Haskell-cafe] Problem with haddock importing definition

David Waern david.waern at gmail.com
Wed May 20 04:43:41 EDT 2009


2009/5/20 Ross Paterson <ross at soi.city.ac.uk>:
> On Wed, May 20, 2009 at 09:42:19AM +0200, David Waern wrote:
>> 2009/5/15 Maurício <briqueabraque at yahoo.com>:
>> > I have a situation like this: module A imports R (a newtype
>> > declaration) from module B, and lists it in its (module A)
>> > export list.
>> >
>> > Documentation for R is included by haddock in documentation
>> > for module A, as I want. However, if my package exposes only
>> > module A, documentation for R desapears.
>>
>> When you say documentation disappears, do you mean that R is still
>> listed, but its comments are not shown, or is R completely absent from
>> the documentation?
>
> See http://trac.haskell.org/haddock/ticket/107
>
> He just needs to include B in the other-modules list, so that cabal will
> pass it to haddock (and setup sdist).

Yes, that is a solution that he can use.

I would still like to know the answer to my question though, since I
think we can improve Haddock here.

Haddock is given a list of modules on the command line, for which it
should create documentation pages. Before Haddock used GHC, it could
not do dependency analysis, so you had to give it both the modules you
wanted pages for, and their dependencies.

Nowadays we do dependency analysis, since we have to typecheck all
modules. But we still only do documentation-processing for the given
modules (I think). This could explain why F appears in the
documentation, but without comments, when only module A is specified
on the command line (assuming this is indeed the problem).

In that case we should enhance Haddock so that it processes all
modules but only creates documentation pages for the specified
modules.

David


More information about the Haskell-Cafe mailing list