I wanted to clarify benefits about currying in scala. According to "Programming in Scala Second Edition" - "currying A way to write functions with multiple parameter lists. For instance
def f(x: Int)(y: Int)
is a curried function with two parameter
lists. A curried function is applied by passing several arguments
lists, as in: f(3)(4)
. However, it is also possible to write a partial
application of a curried function, such as f(3)." "c"
One benefit connected with creation partially applied functions like this
def multiplyCurried(x: Int)(y: Int) = x * y
def multiply2 = multiplyCurried(2) _
But we also can use partially applied functions without currying
def multiplyCurried(x: Int,y: Int)
def multiply2 = multiplyCurried(2, _)
Could you please give a few example, where currying will show benefits ?