Skip to content

Partial Application vs Currying

Daisho Komiyama edited this page Aug 10, 2019 · 3 revisions

Here's tl;dr of Partial Application and Currying characteristics.

  1. Both are specialization techniques
  2. Partial Application presets some arguments now, receives the rest on the next call
  3. Currying doesn't preset any arguments, receives each argument one at a time

If you ever get asked on a future job interview, what's the difference? What's partial application and currying? The answer is, both of them specialize, they do it differently.

  • Partial Application takes some input now, all the rest of the input later
  • Currying takes no input now, each input one at a time
const ajax = curry(3, function ajax(url, data, cb) {
    //some work here
});

//strict currying
ajax(CUSTOMER_API)({id: 42})(renderCustmer);

//loose currying
ajax(CUSTOMER_API, {id: 42})(renderCustmer);
Clone this wiki locally