The correct answer is (b): (f.).g
Let us analyze this function. The (f.)
part is short for ((.) f)
, so we already solved that one, and thus the function - without syntactical sugar - is:
(.) ((.) f) g
Now we can rewrite the first (.)
function to a lambda-expression:
\x -> ((.) f) (g x)
And now when we evaluate the second function on the left (((.) f)
) further, we obtain:
\x -> (.) f (g x)
or:
\x -> f . g x
So if we convert the (.)
function in a lambda expression, we obtain:
\x -> (\y -> f ((g x) y))
Now we can make this expression more elegantly. (g x) y
can be rewritten to g x y
:
\x -> (\y -> f (g x y))
and we can rewrite nested lambda expressions into a single lambda expression:
\x y -> f (g x y)
Which is what we wanted.