lean4-htt/src/Std/Data/Iterators
Paul Reichert 90462e2551
feat: introduce iterator combinators filterMap, filter and map (#8451)
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.
2025-05-30 13:43:41 +00:00
..
Combinators feat: introduce iterator combinators filterMap, filter and map (#8451) 2025-05-30 13:43:41 +00:00
Consumers feat: introduce iterator combinators filterMap, filter and map (#8451) 2025-05-30 13:43:41 +00:00
Internal
Lemmas feat: introduce iterator combinators filterMap, filter and map (#8451) 2025-05-30 13:43:41 +00:00
Producers feat: introduce iterator combinators filterMap, filter and map (#8451) 2025-05-30 13:43:41 +00:00
Basic.lean feat: introduce iterator combinators filterMap, filter and map (#8451) 2025-05-30 13:43:41 +00:00
Combinators.lean feat: introduce iterator combinators filterMap, filter and map (#8451) 2025-05-30 13:43:41 +00:00
Consumers.lean feat: lemmas about iterator collectors (#8380) 2025-05-21 21:11:26 +00:00
Internal.lean
Lemmas.lean feat: introduce take iterator combinator (#8418) 2025-05-30 10:34:12 +00:00
PostConditionMonad.lean feat: introduce iterator combinators filterMap, filter and map (#8451) 2025-05-30 13:43:41 +00:00
Producers.lean