In: Computer Science
The curried version of let f (x,y,z) = (x,(y,z)) is
let f (x,(y,z)) = (x,(y,z)) |
||
Just f (because f is already curried) |
||
let f x y z = (x,(y,z)) |
||
let f x y z = x (y z) |
What is Currying?
In mathematics and computer science, currying is the technique of converting a function that takes multiple arguments into a sequence of functions that each take a single argument. For example, currying a function that takes three arguments creates three functions:
For Ex:
Let there be a function which maps as
Currying the above function will produce
Thus maps from to a function which in turn maps
from to
The above mathematical expression can also be represented as:
Hence,
Find some more examples below to understand it clearly.
As here, the output is (x,(y,z)), output remains constant while currying.
So, f(x, y, z) becomes f x->y->z-> (x,(y,z))
Ans : Therefore f x y z = (x,(y,z))
Thefore C must be the correct option.