Combinator to interpret absence of a field as an empty array
See original GitHub issueThe same way we have jfieldOpt
which interpret the absence of a field as a None, we could add a combinator that interpret the absence as an empty array.
How can we call that combinator?
- jfieldMany
- jfieldRepeated
- jfieldArray
Or maybe we can upgrade the existing jfieldOpt
to handle multiple values.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
How iterating through an empty array works?
Creates an empty array, so the lottery numbers can be stored here, after they're checked for duplicates. There is a for loop and...
Read more >The Verse Programming Language [pdf]
Empty array in this pattern does not represent an error. It represents the fact that no values you asked for can be found....
Read more >How to check if an array is empty using Javascript?
How to check if an array is empty using Javascript? We continue with Flexiple's tutorial series to explain the code and concept behind...
Read more >APLcart - Find your way in APL
Interpret internal representation as array of type 'type' ... Validate numeric input: returns Boolean validity mask and numeric vector of converted input.
Read more >query on array=null not working
I have the following situation: i have a db table called notification; it has a field called "target_users", it's text field but marked...
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
I was analyzing this and came up to with an easy way to have this functionality, with the existing combinators.
Let’s pretend we have a pair of functions to go from/to an option of list / plain list:
Now, we can use them this way:
And we’ll get the desired effect.
This has the additional advantage that we can apply this to any collection, not just lists and arrays.
“jfieldRepeated” repeated is protobuf terminology and will be confusing in fleece context.