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.
Redundant quantification when rendering GADT constructors from external packages #1015
Closed
Description
(Yet another issue noticed in well-typed/generics-sop#92.)
Run Haddock on this code:
module Bug ((:~:)(..)) where
import Data.Type.Equality
And you'll get this:
Notice that the type signature for Refl
quantifies b
, which is completely redundant! The culprit is these lines of code:
haddock/haddock-api/src/Haddock/Convert.hs
Lines 337 to 342 in fd56ac4
This is constructing a type signature for a GADT constructor by displaying all of the universally quantified type variables following by the existentially quantified type variables. But this is not always what the user has written, as shown in the example above. We really ought to be using dataConUserTyVars
instead, which takes this information into account.
Patch incoming.