Filter optional arrays/lists?
- Dominant language
- Reason
- Stars
- 40
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
It's very common to have an array/list of optional items, and to use `get_in` to get the list and then filter out the `None`s. The boilerplate ends up being pretty miserable.
In the same spirit as the current operators, it'd be nice to be able to have an operator that would filter out nullable items, e.g.:
```reason
let data = Some({"gitHub": Some({"user": Some({"repositories": Some({"nodes": Some([None, None, Some({"id": "a"})])})})})});
let repos = gitHub#??user#?repositories#nodes!!
// repos = [{"id": "a"}];
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the implementation and tests for the existing operators referenced in the issue. Compare their behavior with the nested optional-list example, then define the operator's expected handling of None values and verify that the example produces only the non-null repository item.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100