haddock icon indicating copy to clipboard operation
haddock copied to clipboard

Haddock always shows kind signatures for types re-exported from other packages

Open jkoppel opened this issue 5 years ago • 3 comments

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:

Screen Shot 2020-08-20 at 4 30 22 AM

And here it is re-exported in the "essentials" package:

Screen Shot 2020-08-20 at 4 30 46 AM

Yuck!

jkoppel avatar Aug 20 '20 11:08 jkoppel

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.

harpocrates avatar Aug 20 '20 12:08 harpocrates

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

jkoppel avatar Aug 28 '20 07:08 jkoppel

@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

nomeata avatar Oct 07 '22 09:10 nomeata