Applying an argument list to curried function using foldLeft in Scala
Is it possible to do a foldLeft on a list of arguments, where the initial value supplied to the fold is a fully curried function, the operator is apply , and the list is a list of arguments to be passed to function f ? For example, let's say f is defined as: scala> val f = (i: Int, j: Int, k: Int, l: Int) => i+j+k+l f: (Int, Int, Int, Int) => Int = <function4> Which we can of course use directly: scala> f(1, 2, 3, 4) res1: Int = 10 Or curry and apply the arguments one at a time: scala> f.curried res2: Int => Int => Int => Int => Int = <function1> scala> f.curried.apply(1).apply(2).apply(3)