While working with collections in Scala we frequently find ourselves using two most popular Functional combinators i.e, map() and its close cousin flatMap(). Both are higher-order functions. Click here to know more about higher order functions. In this blog, we will explore the the map and flatMap in detail.
map():
The map method transforms a collection by applying a function to each element of that collection.

#functional programming #scala #monads #scala monads

Scala: Map vs flatMap
1.50 GEEK