I came from Java and would like to combine two partial functions like this:
def sum(a: Int, b: Int, c: Int) : Int = a + b + c
I want write something like this:
val l = List(1, 2, 3)
l.foreach(println _ sum (1, _ : Int, 3) ) // It's supposed to apply
// the partial sum(1, _: Int, 3)
// and println computed value.
But it refuses to compile. Is there a way to fix it concisely?