Nicer syntax for higher level functions
- Dominant language
- Jsonnet
- Stars
- 7.6k
- Forks
- 475
- PR merge metrics
- No merged PRs in 30d
Description
I love the pure functional nature of Jsonnet! However, when trying to do things in a functional style, the syntax gets in the way a _bit_ (not a lot, but a _bit_).
For example, defining higher level functions is a bit clumsy:
```jsonnet
local f = function(x) function(y) function(z) z*y*z;
```
I think such functions would be more natural to use, and therefore get used more often, with more succinct syntax – and there's no need to invent anything fancy, since lots of other languages already use either a "fat" or a "thin" _arrow_, `=>` or `->`.
So the above snippet would become:
```jsonnet
local f = x -> y -> z -> z*y*z;
```
This would also be nice and eligible for inline uses, e.g. `std.filter(thing -> thing.isActive, things)`.
Hoping y'all think it makes sense! 🤞
Contributor guide
Assessment
This issue has not been assessed yet.