The type of the Prelude
function flip
is:
flip :: (a -> b -> c) -> b -> a -> c
I.e., it takes one binary function and two arguments.
The type of the Prelude
function id
is:
id :: a -> a
But the type of flip id
is:
flip id :: a -> (a -> b) -> b
How is it possible to apply flip
to id
when id
is a unary function and flip
requires binary function for the first arg?
btw. flip id
is similar to \ x f -> f x