Too many type binders [GHC-05989]
Language extension: StandaloneKindSignatures
This error means that a type constructor is declared with more arguments than are specified in a corresponding standalone kind signature.
Examples
Mismatched data declaration
Error Message
Main.hs:5:1: error: [GHC-05989]
• Not a function kind: *
but extra binders found: y
• In the data type declaration for ‘A’
|
5 | data A x y
| ^^^^^^^^^^
Explanation
This example declares A
to have kind * -> *
, meaning it is a type
constructor that takes one argument. However, the data
declaration for A
has
two arguments (x
and y
), so it does not match the kind signature.
This can be fixed by either updating the data
declaration to match the kind
signature (by removing the argument y
) or updating the kind signature to match
the data
declaration (by adding an argument of kind *
).
Main1.hs
Before
module Main1 where
type A :: * -> *
data A x y
After
module Main1 where
type A :: * -> *
data A x = A x
Main2.hs
Before
module Main2 where
type A :: * -> *
data A x y
After
module Main2 where
type A :: * -> * -> *
data A x y = A x y