Reputation: 41909
Let's say I have part of a function's signature:
f :: (a -> b) -> ...
Is there any restriction (such as their kinds
) on the types of a
and b
?
a
can't be a function, i.e. (c -> d)
, can it?
Upvotes: 2
Views: 72
Reputation: 370102
a
and b
must have kind *
, that is they must not be type constructors that require arguments. So they could be Integer
, (c -> d)
or Maybe String
, but not (->)
, (a ->)
or Maybe
.
a
can't be a function, i.e.(c -> d)
, can it?
Yes, it can. It can be any possible type of kind *
.
Upvotes: 6