Browsing the haddocks of various packages I often come along instance documentations that look like this (Control.Category):
Category k (Coercion k)
Category * (->)
or this (Control.Monad.Trans.Identity):
MonadTrans (IdentityT *)
What exactly here does the kind signature mean? It doesn't show up in the source, but I have already noticed that it seems to occur in modules that use the PolyKinds extension. I suspect it is probably like a TypeApplication but with a kind. So that e.g. the last example means that IdentityT
is a monad transformer if it's first argument has kind *
.
So my questions are:
- Is my interpretation correct and what exactly does the kind signature refer to?
- In the first
Category
instance, how am I supposed to know thatk
is a kind and not a type? Or do I just have to know the arity ofCategory
? - What is the source code analog to this syntax?
I am not asking for an explanation of kinds.