[feature-request] Allow implicit function application syntax for nested index expressions
See original GitHub issueCurrently
# we can do
ys = list(map(.[0], xs))
# and
ys = list(map(.[0, 1], xs))
# but not
ys = list(map(.[0][1], xs))
This nesting is supported in the case of attrgetter
, but not itemgetter
. Instead of compiling to a closure (which we have to do by hand right now, anyway), it can instead compile to an expression of a new built-in function that basically does a ‘nested-get’ on __getitem__
-able objects.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
produce map/object from nested for loop in terraform >0.12
I think there are two feature requests implicit in this issue: nested for expressions, and a function or functions that support creating ...
Read more >Allow nested foralls and contexts in prefix GADT constructors
In fact, having nested forall s is an implicit requirement an already accepted GHC proposal, A syntax for visible dependent quantification.
Read more >Implicit Differentiation With Partial Derivatives ... - YouTube
This Calculus 3 video tutorial explains how to perform implicit differentiation with partial derivatives using the implicit function theorem ...
Read more >Release 2.6.1.1 The Agda Team - Agda User Manual
This is the manual for the Agda programming language, its type checking, compilation and editing system and related resources/tools.
Read more >Adventures in the Terraform DSL, Part III: Iteration ...
List comprehensions in Python; For expressions; Example 6: Transforming ... which for the first time allow generation of nested blocks like ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@narfanar As a simple workaround, you could do
which is probably what
.[0][1]
will get compiled to if this gets implemented.If this is implemented I think
.[x].someattr[y].otherattr
or other arbitrary combination of indexing and attribute access should be allowed.