Shorthand for curried functions
- Dominant language
- Jsonnet
- Stars
- 7.6k
- Forks
- 475
- PR merge metrics
- No merged PRs in 30d
Description
I love partial application, especially in the presence of HOFs, but especially with the [long syntax for lambdas](https://github.com/google/jsonnet/issues/129) 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.
Contributor guide
Assessment
This issue has not been assessed yet.