code-at-work / curry

A flexible implementation

Home Page:https://youtu.be/LAQRhQmBgcU

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

A flexible implementation

https://youtu.be/LAQRhQmBgcU


Languages

Language:JavaScript 100.0%