Higher-kinded Polymorphism
A type class need not take a type variable of kind *, but can take one of any kind. These type classes with higher kinds are sometimes called constructor classes (the constructors referred to are type constructors such as Maybe, rather than data constructors such as Just). An example is the monad class:
class Monad m where (>>=) :: m a -> (a -> m b) -> m b return :: a -> m aThe fact that m is applied to a type variable indicates that it has kind * -> *, i.e. it takes a type and returns a type.
Read more about this topic: Type Class
Related Subjects
Related Phrases
Related Words