This image comes from this article. It shows a nice way to use
map instead of match/case when processing an
Option in Scala, and also shows a
For many more ways to work with an Option and higher-order functions, see my tutorial, How to use higher-order functions with Option (instead of using match expressions).