Can I write a higher order type for a -> b -> *?

Viewed 145

I understand that (->) a is a higher order type of kind * -> *, that when applied to a type argument b gives the type a -> b

Can I write a type of kind * -> * that when applied to c would give a -> b -> c?

If not, why not? Maybe using some language extensions and forall?

This would let me write instances of Functor and Applicative (and other classes) where the functorial structure is "a -> b ->" as in:

(<*>) :: Applicative t => t (c -> d) -> t c -> t d

(<*>) :: (a -> b -> c -> d) -> (a -> b -> c) -> a -> b -> d

This would be useful as a combinator for binary (curried) functions.

NB. Maybe this is related Functors and Applicatives for types of kind (* -> *) -> * but I'm not sure, because it went over my head :-)

1 Answers
Related