Skip to content

Instantly share code, notes, and snippets.

@Gikkman
Created December 13, 2019 12:54
Show Gist options
  • Select an option

  • Save Gikkman/0b5420b8f0bc78a9c5d7222843908dbf to your computer and use it in GitHub Desktop.

Select an option

Save Gikkman/0b5420b8f0bc78a9c5d7222843908dbf to your computer and use it in GitHub Desktop.
Short curry function for Javascript
// Tiny, recursive autocurry
const curry = (
f, arr = []
) => (...args) => (
a => a.length === f.length ?
f(...a) :
curry(f, a)
)([...arr, ...args]);
@Gikkman

Gikkman commented Dec 13, 2019

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment