This PR provides the iterator combinator `filterMap` in a pure and monadic version and specializations `map` and `filter`. This new combinator allows to apply a function to the emitted values of a stream while filtering out certain elements. `map` should have an optimized `IteratorCollect` implementation but it turns out that this is not possible without a major refactor of `IteratorCollect`: `toArrayMapped` requires a proof that the iterator is finite. If `it.mapM f` is `Finite` but `it` is not, then such a proof does not exist. `IteratorCollect` needs to take a proof that the loop will terminate for the given monadic function `f` instead. This will not be done in this PR. |
||
|---|---|---|
| .. | ||
| Combinators | ||
| Consumers | ||
| Internal | ||
| Lemmas | ||
| Producers | ||
| Basic.lean | ||
| Combinators.lean | ||
| Consumers.lean | ||
| Internal.lean | ||
| Lemmas.lean | ||
| PostConditionMonad.lean | ||
| Producers.lean | ||