This repository was archived by the owner on Aug 3, 2024. It is now read-only.
This repository was archived by the owner on Aug 3, 2024. It is now read-only.
Haddock renders imported data types with polymorphic return kinds incorrectly #1004
Closed
Description
(Originally discovered in well-typed/generics-sop#92).
Run Haddock on this file:
module Bug (Product(..)) where
import Data.Functor.Product
And you'll get this:
That return kind is entirely wrong, given that we're also pretty-printing the type variable binders for Product
itself. I was under the false impression that I had already fixed this issue in #702, but now that I look more carefully at the code that I added:
haddock/haddock-api/src/Haddock/Convert.hs
Lines 275 to 280 in 44169f4
It turns out my solution wasn't sufficiently general. We're using splitFunTys
here, but that won't work in the case where the return kind is headed by a forall
(such as in the example above). A more robust solution is to use dropForAlls
followed by splitFunTys
.
Patch incoming.