Vavr’s flatMap in action
https://blog.softwaremill.com/vavrs-flatmap-in-action-a975a99c4319
TL;DR Whenever your cargo is inside a ship carried by another ship — flatMap that ship!
Programming is often about transforming data from one type to another. Vavr provides the map method which is invoked during a so-called happy path: you map a Try’s success, an Option’s value, an Either’s right, a Future’s successful result and finally a List’s element.