shapesecurity / shape-functional-java

add some FP familiarity to a Java project
Apache License 2.0
8 stars 7 forks source link

add `filterWithIndex`, etc, to ImmutableList #110

Closed bakkot closed 2 years ago

bakkot commented 3 years ago

mapWithIndex is great, but sometimes you need the index during other operations. Currently you have to do .mapWithIndex(Pair::of).filter(pair -> ...).map(Pair::right), which is painful (and a lot of allocations).