Skip to content

Instantly share code, notes, and snippets.

@coderitual
Created March 5, 2017 14:14
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 coderitual/8f562a89641354f1c1e56178fc4efcd9 to your computer and use it in GitHub Desktop.
Save coderitual/8f562a89641354f1c1e56178fc4efcd9 to your computer and use it in GitHub Desktop.
// 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