
2009/5/20 Ross Paterson
On Wed, May 20, 2009 at 09:42:19AM +0200, David Waern wrote:
2009/5/15 MaurĂcio
: 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