Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uncurry #4

Open
raganwald opened this issue Mar 7, 2013 · 2 comments
Open

uncurry #4

raganwald opened this issue Mar 7, 2013 · 2 comments

Comments

@raganwald
Copy link
Owner

No description provided.

@reinh
Copy link
Contributor

reinh commented Apr 10, 2013

Would this just be:

uncurry = (fn) -> return -> fn.apply @, arguments...

@raganwald
Copy link
Owner Author

Something like that. If we have a very simple curry that works with functions taking two arguments:

curry = (fn) -> (x) -> (y) -> fn(x, y)

uncurry reverses the operation:

uncurry = (fn) -> (x, y) -> fn(x)(y)

Most of the currying in allong.es is self-uncurrying in that you can call things like map or getWith using either map(list)(fn) or map(list, fn). But I could add a variadic uncurry that can handle any number of arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants