Usefulness (as in practical applications) of Currying v.s. Partial Application in Scala
问题 I\'m trying to understand the advantages of currying over partial applications in Scala. Please consider the following code: def sum(f: Int => Int) = (a: Int, b: Int) => f(a) + f(b) def sum2(f: Int => Int, a: Int, b: Int): Int = f(a) + f(b) def sum3(f: Int => Int)(a: Int, b: Int): Int = f(a) + f(b) val ho = sum({identity}) val partial = sum2({ identity }, _, _) val currying = sum3({ identity }) val a = currying(2, 2) val b = partial(2, 2) val c = ho(2, 2) So, if I can calculate partially