Created
April 5, 2018 09:19
-
-
Save indongyoo/95c6be70674f3a788b925c6bb38692b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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