Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haddock for Char doesn't mention all classes it instantiates #123

Closed
yaitskov opened this issue Jan 27, 2023 · 3 comments
Closed

Haddock for Char doesn't mention all classes it instantiates #123

yaitskov opened this issue Jan 27, 2023 · 3 comments
Labels
out-of-scope Unrelated to CLC or does not need a CLC approval

Comments

@yaitskov
Copy link

Hi,

Haddock for Char from the latest ghc-prim has a strange description, because it talks about applicability of Enum methods, though Char has instances just for Eq and Ord. Where is Show? The list on Haddock doesn't match what GHCi gives via :i Char

Links to enum methods and ord/chr ones give 404.

https://hackage.haskell.org/package/ghc-prim-0.9.0/docs/Data-Char.html#v:ord
https://hackage.haskell.org/package/ghc-prim-0.9.0/docs/Prelude.html#v:fromEnum

What do you think about some web crawler to verify links against 404s?

@Bodigrim
Copy link
Collaborator

That's because some instances of Char are defined in ghc-prim and some in base, but haddock comment must be shared by both of them. Users should rather refer to https://hackage.haskell.org/package/base-4.16.0.0/docs/Data-Char.html#t:Char.

That said, documentation issues or haddock infelicities are out of scope for CLC. Please raise an issue at GHC bug tracker instead.

@Bodigrim Bodigrim added the out-of-scope Unrelated to CLC or does not need a CLC approval label Jan 27, 2023
@yaitskov
Copy link
Author

Link to Char Haddock was generated by HLS.

@Bodigrim
Copy link
Collaborator

Bodigrim commented Jan 28, 2023

It might be a good idea for HLS to implement a special treatment for this scenario. While normally when an entity is re-exported from several packages (as Char is defined in ghc-prim and re-exported from base), it is better to point to the original source, here we almost never want to send users to ghc-prim for entities available from base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
out-of-scope Unrelated to CLC or does not need a CLC approval
Projects
None yet
Development

No branches or pull requests

2 participants