
Haskell Design Patterns
By :

Type families bring functions to the type-level. Polymorphic kinds bring polymorphism to the kind-level. Type promotion bring datatypes and type-safety to the kind-level.
Two major problems of the Haskell kind system are solved by these extensions:
The kind system is too restrictive (because it lacks polymorphism)
Solution: Provide polymorphism on the kind level (PolyKinds)
The kind system is too permissive (kinds are too vague)
Solution: Promote datatypes to kinds to simulate a type-system on the kind-level (DataKinds)
Haskell98 already carried the seed for type-level programming by including multiparameter type-classes. Since then, the Haskell kind-system has been enriched with functional dependencies, GADTs, type families, kind polymorphism, and type-promotion.
Together, these extensions provide the building blocks for type-level programming in Haskell.
Returning to our earlier example, let's write a type-level function that computes type-level numbers. Since we have...
Change the font size
Change margin width
Change background colour