score:2

Accepted answer

writing simply sum _ does not yet have anything to do with the arguments of sum, but simply distinguishes the function object sum from an application of the function.

hence, you can write:

scala> val partfunc2 = sum _
partfunc2: int => (int => int) = <function1>

as you can see from the type information, this is already the curried version of sum which takes two int parameters.

of course, you can then proceed as before with partfunc2(4) being of type int => int and so on.

score:1

you can do it like this:

val partfunc2 = sum _

or like this:

val partfunc2 = sum(3) _

Related Query

More Query from same tag