Skip to content

Instantly share code, notes, and snippets.

@davidjbeveridge
Created July 17, 2013 06:31
Show Gist options
  • Save davidjbeveridge/6018118 to your computer and use it in GitHub Desktop.
Save davidjbeveridge/6018118 to your computer and use it in GitHub Desktop.
More stable currying w/ variable args
curry = (fn, args...) ->
old_args = args.slice()
currier = (x...) ->
if arguments.length is 0
val = fn(args...)
args = old_args
val
else
args = [args..., x...]
currier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment