Kind

From HaskellWiki
Revision as of 05:47, 15 November 2011 by F.s. (talk | contribs) (+See also)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Kinds classify types. Kinds are to types and type-constructors what types are to values.

Ordinary types have kind *. Type constructors have kind P -> Q, where P and Q are kinds. For instance:

Int :: *
Maybe :: * -> *
Maybe Bool :: *
a -> a :: *
[] :: * -> *
(->) :: * -> * -> *

In Haskell 98, * is the only inhabited kind, that is, all values have types of kind *. GHC introduces another inhabited kind, #, for unboxed types.

See also