Partial application creates a new function by fixing some arguments of an existing function, leaving fewer arguments to provide. It specializes a general operation for reuse. section 3.1
Partial application and currying manipulate functions differently:
- Partial application fixes selected arguments, producing a function with fewer parameters. section 3.1.2
- Currying transforms a multi-argument function into a sequence of single-argument functions. section 3.1.1
- Combining currying with partial application can make specialization more concise than placeholder syntax. section 3.1.1
Specializing a three-argument addition function
Given add(x, y, z), fixing x to 5 produces addFive, which accepts only y and z. Calling addFive(2, 3) supplies the remaining arguments and returns 10. section 3.1
def add(x: Int, y: Int, z: Int): Int = x + y + z
The listing provides the original three-argument function that partial application specializes. section 3.1












