Whenever I want to filter an iterator, I always reach for filter. However, even though I come from the land of haskell, I always forget which way the predicate lies. Does it keep elements for which the predicate returns true, or false?
I propose this function be split up into 2: keep_if and skip_if.
I agree with reasoning behind this “should it be true or false”.
But I don’t think “skip_if” is a great name in a presense of “skip_while”, though just “keep_if” sounds good.
Where is already a language keyword (used for more generalized bounds on types) and I wouldn’t favor trading its current use for an arguably better method name on iterators.
I don’t mean to imply that my names are the only one. Only that filter does not give any indication as to the direction of the boolean, and a name that does should be used instead. select/reject would be fine, as would where, etc.