Skip to content

code-at-work/curry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c05f03d · Jan 20, 2019

History

1 Commit
Jan 20, 2019
Jan 20, 2019
Jan 20, 2019
Jan 20, 2019
Jan 20, 2019
Jan 20, 2019
Jan 20, 2019

Repository files navigation

Partial application and curring for functions

Here the video: https://youtu.be/LAQRhQmBgcU

A simple example of partial application and curring applied to functions

Curring

const curry = require('.');

const sum = curry((a,b) => a+b);

sum(1,1)  // direct 2
sum(1)(1) // with curry 2

Partial Application

const curry = require('.');

const sum = curry((a,b,c) => a+b+c);

sum(1,1,1)   // direct 3
sum(1)(1)(1) // with curry 3
sum(1,1)(1)  // with left partial application
sum(1)(1,1)  // with right partial application