Kind Annotations
Brief explanation
In Haskell 98, each type constructor and variable has a kind. Though the Report uses a notation for kinds, they do not appear in Haskell source.
GHC permits types and new type constructors and variables to be annotated with a kind signature, e.g.
type T (f :: * -> *) = f Int
References
- Kinds in the Haskell 98 report
- Explicitly-kinded quantification in the GHC User's Guide
Tickets
#84 | Kind Annotations |
---|
Pros
- Allows more machine-checked documentation.
- Haskell 98 defaults kinds to
*
, which is a nuisance if you want a higher kind. Kind annotations remove the need for awkward workarounds like dummy data constructors. See KindInference for alternative solutions to this problem.
Cons
- con
Proposal
To adopt explicit kind annotations as part of the language, more or less exactly as GHC permits.