In which way do kinds associate in haskell?

62 views Asked by At

i have given the task to give an example for a type constructor of the kind

* -> (* -> *)

but I can't find one.

My guess is that kinds associate to the right, so that the above given kind is the same as

* -> * -> *

In that case Either would be an example, wouldn't it?

1

There are 1 answers

2
leftaroundabout On BEST ANSWER

Yes.

Prelude> :set -XKindSignatures 
Prelude> :k (Either :: * -> (* -> *))
(Either :: * -> (* -> *)) :: * -> * -> *

BTW, the * notation will be deprecated. The modern version is called Type.

Either :: Type -> Type -> Type