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

Shorthand for curried functions #223

Open
copumpkin opened this issue Jul 24, 2016 · 1 comment
Open

Shorthand for curried functions #223

copumpkin opened this issue Jul 24, 2016 · 1 comment

Comments

@copumpkin
Copy link

copumpkin commented Jul 24, 2016

I love partial application, especially in the presence of HOFs, but especially with the long syntax for lambdas it's currently pretty heavyweight to write those. Even if the syntax were more lightweight, I believe the following could be quite nice:

local foo(params1)(params2) = ...;

as shorthand for:

local foo(params1) = function (params2) ...;

Given that we already have the local foo(params) = ... as sugar for local foo = function(params) ..., it seems like iterating the current rule for each group of parentheses would be a nice generalization of the syntax. Same would apply to object "keys", as well as anonymous functions.

@sparkprime
Copy link
Member

sparkprime commented Jul 25, 2016

This looks quite unintrusive and it's nice that the definition syntax still resembles the calling syntax.

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

No branches or pull requests

2 participants