Problem with haddock importing definition

Hi, 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. So: if my .cabal file lists A and B in 'exposed-modules', documentation for R is included in A documentation. If I remove B from 'exposed-modules', R documentation in A desapears. Do you know what should I do? Thanks, Maurício

2009/5/15 Maurício
Hi,
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.
Hi Mauricio, sorry for the late reply. 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? Thanks, David

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).

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

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?
He just needs to include B in the other-modules list, so that cabal will pass it to haddock (and setup sdist).
I would still like to know the answer to my question though, since I think we can improve Haddock here.
R is completely absent from documentation. I did include a working example with .cabal file in that ticket, maybe that can help. (Just to note, my problem was solved by 'other-modules'.) Thanks, Maurício

2009/5/20 Maurício
I would still like to know the answer to my question though, since I think we can improve Haddock here.
R is completely absent from documentation.
OK. That's strange. I thought that Haddock would at least show R but without a link.
I did include a working example with .cabal file in that ticket, maybe that can help.
(Just to note, my problem was solved by 'other-modules'.)
I saw that - thanks. Couldn't investigate it yet since I'm at work :-) David
participants (3)
-
David Waern
-
Maurício
-
Ross Paterson