Last active
August 5, 2019 20:51
-
-
Save kutyel/818937bda1bf1f513ff63e517342d194 to your computer and use it in GitHub Desktop.
My own implementation of curry π
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
// Ultimate version | |
const curry = (f, ...args) => | |
f.length <= args.length | |
? f(...args) | |
: x => curry(f, ...args, x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks @kutyel! I'd remove all the additional parameters. For example, this situation would be possible:
Thanks again!