Your correctly figured out the type of the (.)
in (.) foldr
. The (.)
is applied to one argument (the foldr
) so you can throw away the ((a2 -> b2 -> b2) -> (b2 -> [a2] -> b2))
and what remains is the type of (.) foldr
:
(a1 -> a2 -> b2 -> b2) -> a1 -> (b2 -> [a2] -> b2)
Make sure that foldr
can have type ((a2 -> b2 -> b2) -> (b2 -> [a2] -> b2))
before you throw it away. If you got the matching right, this check cannot fail, but it is a good sanity check.