The nameReduceIfis quite confusing to me. Something likeStopIf or StopWhen would make a lot more sense. Iterators.takewhile is a related concept, but the predicate has opposite polarity, and as was pointed out on Zulip, handles the final element differently.
I don't think there's a direct connection between ReduceIf and e.g. Base.reduce, which is like "fold".
The name
ReduceIf
is quite confusing to me. Something likeStopIf
orStopWhen
would make a lot more sense.Iterators.takewhile
is a related concept, but the predicate has opposite polarity, and as was pointed out on Zulip, handles the final element differently.I don't think there's a direct connection between
ReduceIf
and e.g.Base.reduce
, which is like "fold".(from a Zulip discussion with @masonprotter)