Currying transforms a function that accepts multiple arguments into a sequence of single-argument functions. Calling each function in turn produces the same result while making function composition more fluid. section 3.1.1 section 3.1.2
Currying differs from partial application in its purpose:
- Currying reshapes f(x, y, z) into f(x)(y)(z), creating a chain of single-argument functions. section 3.4
- Partial application fixes selected arguments to create a specialized function for reuse. section 3.1.2
- Together, currying and partial application provide concise ways to break complex functions into smaller components. section 3.1.1 section 3.1.2
Curried addition
A curried three-argument addition function can be called as curriedAdd(1)(2)(3), producing 6. Fixing the first argument creates addFive, a reusable function that awaits the remaining arguments. section 3.1.1
def curriedAdd(x: Int)(y: Int)(z: Int): Int = x + y + z
Inspect the Scala-style definition showing one parameter list for each stage of the curried function. section 3.1.1









