Created
June 13, 2017 12:01
-
-
Save matt-mcmahon/e132bee55381cbeaa4de13e27fefdee1 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
// Auto Curry "Magic Spell", by Eric Elliott | |
// https://medium.com/javascript-scene/a-functional-programmers-introduction-to-javascript-composing-software-d670d14ede30 | |
const curry = ( | |
f, arr = [] | |
) => (...args) => ( | |
a => a.length === f.length ? | |
f(...a) : | |
curry(f, a) | |
)([...arr, ...args]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment