Higher-order kinds
Types classify values at different levels of abstraction, for example:
ÂÂ-- Primitive types ÂÂ-- "a string" :: String ÂÂ-- 12 :: Int --ÂÂ instances of higherÂorder, parametrized types ÂÂ-- Just 10 :: Maybe Int ÂÂ-- Left 10 :: Either Int b ÂÂ-- functions are first class values ÂÂ-- (* 2) :: Num a => a Â> a ÂÂ-- typeÂconstructors are functions ÂÂ-- Just :: a Â> Maybe a ÂÂ-- Left :: a Â> Either a b
In a similar way, kinds classify types. For monomorphic types (that is, not polymorphic), the kind signature is just the placeholder *:
ÂÂ-- TYPE KIND ÂÂ-- [Char] :: * ÂÂ-- Maybe Int :: *
Parametric types express higher-order kinds, for example:
Maybe :: * -> * -- a -> Maybe a
where (* -> *) is a placeholder for a -> Maybe a. Let's compare this with the kind signature of Either:
ÂÂ-- Either * -> * -> * ÂÂ-- a -> b -> Either a b
The Haskell...