Skip to content

Instantly share code, notes, and snippets.

@indongyoo
Created April 5, 2018 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indongyoo/95c6be70674f3a788b925c6bb38692b0 to your computer and use it in GitHub Desktop.
Save indongyoo/95c6be70674f3a788b925c6bb38692b0 to your computer and use it in GitHub Desktop.
const add = (a, b) => a + b;
const sub = (a, b) => a - b;
const mult = (a, b) => a * b;
const baseCalcF = calc => (...fs) => a => go(
map(f => f(a), fs),
reduce(calc));
// 5 + 10, 5 + 20
baseCalcF(add)(a => a + 10, a => a + 20)(5);
// 40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment