GHC/Kinds

Kinds (this is not the definitive name) will be a language extension adding a kind level and some kind polymorphic support to Haskell.

What does this extension do?

Haskell defines kinds as κ ::= * | κ -> κ. Nowadays, programmers use type-level computation more often using GADTs and type families. The need of a well-kinded type-level computation has become bigger. This extension provides a simple mechanism called promotion to populate the kind level.

Each time the user defines a promotable data type at the term level they are able to use it at the type level too. For instance, the user can write the following example:

How do I use it?

Which data types are promotable?

A data type is promotable if its type constructor and data constructors are. A type constructor is promotable if it is of the form *->..*->* which is a first-order Haskell98 type constructor. All Haskell98 data constructors of a first-order Haskell98 data type are promotable. More details can be found in this paper.

A simple way to decide if your data type is promotable is to see if you can write without the where-clause like this: