Y
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
dehrmann
490 days ago
Is it worth using a custom library so you can do
.flatMap(Maybe::stream)
instead of
.filter(Optional::isPresent).map(Optional::get)
link
.flatMap(Maybe::stream)
instead of
.filter(Optional::isPresent).map(Optional::get)