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

haddock points to reexported symbol even if a symbol is imported through another module #1530

Open
guibou opened this issue Oct 19, 2022 · 2 comments
Labels

Comments

@guibou
Copy link
Contributor

guibou commented Oct 19, 2022

In my module, I'm importing Data.Text.Text and using it in a function signature.

However, my library depends on text and foldl and foldl reexports Text in the Control.Foldl.Text module.

Even if I'm not importing Control.Foldl.Text in my module, haddock generates links documentation to this module instead of a link to the Data.Text.Text module.

For exemple:

I've created a new library with cabal init which contains this file:

module MyLib (someFunc, fiz) where

import Data.Text

fiz :: Text
fiz = undefined

someFunc :: IO ()
someFunc = putStrLn "someFunc"

Note: this is the default library generated by cabal init with the added (and exported) fiz symbol.

Note that it imports the Data.Text module.

If I only depend on text on my cabal file, the generated haddock correctly points to Data.Text.Text. However, if I'm adding foldl in my cabal file, the generated documentation points to Control.Foldl.Text, as you can see here:

image

Changing the order of the dependencies in the cabal file does not change the result.

@guibou
Copy link
Contributor Author

guibou commented Oct 19, 2022

Tried with haddock with ghc 9.0.2

@Kleidukos Kleidukos added the bug label Oct 19, 2022
@dschrempf
Copy link

Could it be that this bug affects re-exports in a more general way? I have something like:

import Data.Attoparsec.ByteString.Char8

fooP :: Parser a
...

and haddock reports

could not find link destinations for:

	- Data.Attoparsec.ByteString.Internal.Parser

but Parser is re-exported by Data.Attoparsec.ByteString.Char8.

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

No branches or pull requests

3 participants