article.author.flatMap(_.address).flatMap(_.city).map(_.toLowerCase).foreach(println)
And in for-comprehension version there is no need to use yield, as we don't need result of println.
Wouldn't fit into the map type signature otherwise.
article.author.flatMap(_.address).flatMap(_.city).map(_.toLowerCase).foreach(println)
And in for-comprehension version there is no need to use yield, as we don't need result of println.