itertools
itertools copied to clipboard
flat_map_ok
Similar to #522, which defines flatten_ok, there could also be a flat_map_ok which operates on an IntoIter<Item = Result<T, E>>, applies a function to T if the value is Ok and flattens the result of that function. It should be equivalent to iterator.map_ok(function).flatten_ok().
And what about something that acts like iterator.map(function).flatten_ok()?
Hmm, is it really best to have an _ok version of just about everything?
Are these scenarios where it might be better to use something like https://docs.rs/fallible-iterator/0.2.0/fallible_iterator/trait.FallibleIterator.html that's specifically for the Result case?
I feel the two projects should be merged. rust-itertools and fallible-iterator just include similar implementations but different interfaces.