Example - function runKleisli
from Haskell base module
newtype Kleisli m a b = Kleisli { runKleisli :: a -> m b }
That means runKleisli
have 1 argument with type a
and must return function m
, which have 1 argument b
?
Example - function runKleisli
from Haskell base module
newtype Kleisli m a b = Kleisli { runKleisli :: a -> m b }
That means runKleisli
have 1 argument with type a
and must return function m
, which have 1 argument b
?
It means m
is a type of kind * -> *
; that is, m
is a type constructor that accepts a single argument, like Maybe
or Either String
. When you instantiate Kleisli
and perform the substitution yourself, you can see how this works out.
For example, consider something like Kleisli Maybe String Integer
. The substituted type of runKleisli
would be String -> Maybe Integer
, and you can see how the m
is being used as a type constructor.
For more information about kinds in Haskell, see What exactly is the kind "*" in Haskell?.