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?
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?
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.
acan't be a function, i.e.(c -> d), can it?
Yes, it can. It can be any possible type of kind *.