haddock
haddock copied to clipboard
Haddock always shows kind signatures for types re-exported from other packages
This is a resurrection of #548 . It's either back, or was incompletely fixed.
I'm currently updating documentation for a fork of the compdata package ( https://hackage.haskell.org/package/compdata-0.12 ), which has some complicated type signatures.
Here's a core function in the original package:
And here it is re-exported in the "essentials" package:
Yuck!
Do you have a link to the essentials package? Part of the issue is that sometimes just rendering variables without kind signatures throws away information that can't be figured out otherwise. When you re-export a function, Haddock fetches out GHC's interface representation of project's type and tries to re-create a source-level signature. Figuring out which type variables are redundant and which are not is a hard problem for Haddock.
The fix to #548 did exactly what the initial reporter suggested: remove kind signatures when they are just :: Type.
Hi Alec,
Here's the Essentials package: https://github.com/cubix-framework/cubix/blob/master/src/Cubix/Essentials.hs
And here's the Haddock: https://s3.amazonaws.com/www.cubix-framework.com/docs/cubix-0.5.0.0/Cubix-Essentials.html
@profpatsch, this is what what we observed.
Happens with Functor, for example:
- https://hackage.haskell.org/package/base-4.17.0.0/docs/Prelude.html#t:Functor
- https://hackage.haskell.org/package/ghc-9.4.2/docs/GHC-Prelude.html#t:Functor
and this also confuses hoogle, which now thinks they are two different things:
https://hoogle.haskell.org/?hoogle=Functor