When I first came across the terms “currying” and “partial application” I was a bit confused about the difference. Here is my attempt at an explanation1. I’m not 100% confident of my understanding, so please point out any inconsistencies – I’m happy to be corrected :).
Consider a call that takes 2 arguments and returns some value2:
Currying is the process of converting this to a function that takes a single argument, and returns another function that takes a single argument.
For functions with more than 2 arguments, we can use currying to convert it to a series of functions that each take a single argument:
Partial application is when we can have a function that takes multiple arguments, give it a subset of those arguments, and get back a function that will take the remaining arguments. With curried functions we get this ability for free, but you could imagine a language feature that implements this for uncurried functions:
I think it is correct to say that all curried functions support partial application, but not all partial application implementations require currying.
Also left as a comment to this post, modified slightly here↩
See Reading type annotations if this style of writing out types is unfamiliar.↩