Hacker News new | ask | show | jobs
by ai_ 491 days ago
It's useful for combinators, like flatMap. For instance if you want to flatten an iterator of optional values into the values of all some elements.
1 comments

Is it worth using a custom library so you can do

.flatMap(Maybe::stream)

instead of

.filter(Optional::isPresent).map(Optional::get)