Kind
From HaskellWiki
(Difference between revisions)
m (+See also) |
|||
| Line 11: | Line 11: | ||
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 [[unboxed type]]s. | 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 [[unboxed type]]s. | ||
| + | |||
| + | = See also = | ||
| + | |||
| + | * [[GHC/Kinds]] | ||
[[Category:Language]] | [[Category:Language]] | ||
Revision as of 05:47, 15 November 2011
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.
