diff --git a/recitation-sessions/recitation-session-2.md b/recitation-sessions/recitation-session-2.md index fb814cdc295a96bd41600bb72f83946c7551d3b9..12d94848a00750d6607169e0a9111765ed1e926c 100644 --- a/recitation-sessions/recitation-session-2.md +++ b/recitation-sessions/recitation-session-2.md @@ -40,20 +40,18 @@ _Hint_: What values should be returned by `repeated(x => x + 1, 0)` and `repeate ## Exercise 3.1 -Define the function `curry2`, that curries a two arguments function. That is, `curry2(f) = f'` such that `f(x, y) == (f'(x))(y)` +Define the function `curry2`, that curries a two arguments function. That is, `curry2(f) = g` such that `f(x, y) == (g(x))(y)` ```scala -def curry2(f: (Int, Double) => Boolean): Int => (Double => Boolean) = ??? +def curry2(f: (Double, Int) => Boolean): Double => (Int => Boolean) = ??? ``` -_Hint_: what should `curry2((x, y) => x + y)(1.0)` return? - ## Exercise 3.2 Define the function `uncurry2`. It takes a curried function, and creates a two-argument function. ```scala -def uncurry2(f: Int => Double => Boolean): (Int, Double) => Boolean = ??? +def uncurry2(f: Double => Int => Boolean): (Double, Int) => Boolean = ??? ``` ## Exercise 4.