concept kind in category haskell

This is an excerpt from Manning's book Haskell in Depth.
Haskell uses its kind system to tell the lifted types from unlifted ones. The kind
*(or it’s synonym, theTypekind) refers to the lifted boxed types only. In fact, it is defined via more general machinery briefly presented as follows:
We’ll meet other kinds besides
TypeandConstraintlater in this chapter. But now let’s answer the final question for this pretty explorational subsection: can we classify kinds? The answer may be a bit surprising. The namesTypeandConstraintare not available by default, but they can be imported from theData.Kindmodule. Let’s find out whether they have type or kind or something else:ghci> import Data.Kind (Type, Constraint) ghci> :type Type <interactive>:1:1: error: Data constructor not in scope: Type ghci> :kind Type Type :: Type ghci> :kind Constraint Constraint :: TypeSo, the
Typekind is not defined at term-level (at least for now). As a result, we can’t use:typefor it, but it has a kindType! Same with theConstraintkind. All this means that kinds are nowadays also types and can be classified by kinds. There is ongoing research on unifying types and terms in Haskell so that types could become terms and we could classify them by types. When this is implemented, we would not need kinds anymore and safely forget about them. Funnily, there was a period in GHC history when kinds were classified by sorts (please, don’t ask me about classifying sorts at those times, as there was only one sort, calledBOX), but that period is over. Chances are, we will not need kinds in Haskell either in some near future. Figure 11.1 illustrates the current division between terms and types in Haskell with mappings over them.Figure 11.1. Terms, types and kinds in Haskell
![]()