Why is there no function Stream.flatMap()
(without any parameters) to flatten a Stream<Stream<T>>
?
It would simply be implemented as Stream.flatMap(o -> o)
.
In my opinion, this is by far the most common use of flatMap(Function mapper).
I would imagine because it's trivial to use
import static java.util.function.Function.identity;
...
streamOfStreams.flatMap(identity())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With