What is the difference between the map
and flatMap
functions of Iterable
?
The above is all true, but there is one more thing that is handy: flatMap
turns a List[Option[A]]
into List[A]
, with any Option
that drills down to None
, removed. This is a key conceptual breakthrough for getting beyond using null
.