Kind: Difference between revisions
(Include Wikipedia introduction, which is clearer (to me) and link to TaPL) |
Takenobu.hs (talk | contribs) m (change unboxed to unlifted type) |
||
Line 10: | Line 10: | ||
(->) :: * -> * -> * | (->) :: * -> * -> * | ||
In Haskell 98, <TT>*</TT> is the only '''inhabited kind''', that is, all values have types of kind <TT>*</TT>. GHC introduces another inhabited kind, <TT>#</TT>, for [[ | In Haskell 98, <TT>*</TT> is the only '''inhabited kind''', that is, all values have types of kind <TT>*</TT>. GHC introduces another inhabited kind, <TT>#</TT>, for [[unlifted type]]s. | ||
= See also = | = See also = |
Revision as of 15:41, 31 December 2015
Wikipedia says, "In type theory, a kind is the type of a type constructor or, less commonly, the type of a higher-order type operator. A kind system is essentially a simply typed lambda calculus 'one level up,' endowed with a primitive type, denoted * and called 'type,' which is the kind of any (monomorphic) data type."
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 unlifted types.