Press "Enter" to skip to content

Currying and Partial Application

Prakhar explains the difference between currying and partial application:

Currying simply means converting a function taking more than one parameter can be into a series of functions with each taking one parameter. Example:

Click through for an example, as well as the difference between currying and partial application. As for why currying is important, this is how we tie together the concept of mathematical functions, which require exactly one parameter (a function being defined as, for every value of the domain, there is one and only one value of the range), with computer science functions, which may have multiple parameters. Currying allows us to bridge that gap without needing to write loads of intermediary functions.