Created
March 5, 2017 14:14
-
-
Save coderitual/8f562a89641354f1c1e56178fc4efcd9 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
// Tiny, recursive autocurry | |
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