The name currying is a reference to the mathematician and logician Haskell Curry. The process of currying consists of transforming a function that takes multiple arguments into a sequence of functions, each with a single argument.
Currying and partially applied functions
Function value
Before we start currying functions, we need to understand the difference between a function and a function value.
You are already familiar with functions—they begin with the keyword def, take one or several parameter lists between () symbols, optionally declare a return type after a : sign, and have a defined body after the = sign, as shown in the following example:
def multiply(x: Int, y: Int): Int = x * y
// multiply: multiply[](val...