Type Class - Higher-kinded Polymorphism

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 a

The 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