Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Section comments are missing when re-exporting the module itself #1524

Open
geroldmeisinger opened this issue Aug 29, 2022 · 0 comments
Open

Comments

@geroldmeisinger
Copy link

geroldmeisinger commented Aug 29, 2022

module Foo where

-- * Section

-- | foo function
foo :: Int
foo = 123

=> Section is shown

module Foo (module Foo) where

-- * Section

-- | foo function
foo :: Int
foo = 123

=> Section is missing

The reason why I need the second version is because I have to re-export other modules as well.

module Foo (module Foo, module X) where
import Control.Arrow as X
...

From the documentation I understand that haddock tries to "specifies the order that entities will be listed in the generated documentation.". "without an export list:" "the section headers (e.g. -- * Image importers) now appear in the module body itself,". I don't want to use an export list which list all functions again, just refer to other modules (and the module itself). "If they are imported wholly and without any hiding qualifiers, then the documentation will just contain a cross-reference to the documentation for B and C.". So I guess there is a special case when re-exporting the module itself (I cannot hide anything, but Haddock also doesn't just include a "cross-reference".. to nothing), hence Haddock generates documentation of all exports in no specific order and ignores section.

I would expect the re-export of the "self" module to act as if no export list was given for the module and use the order in the body, and include all other modules in order specified by the export list.

related issues:
issue #958 Question: including re-exported module's documentation
issue #1249 Inline section headings with explicit export list
issue #1106 Controlling the documentation for reexported modules
issue #584 Bugs in Haskell-level Re-exports

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant