Core concept
Option(1).flatMap(x => Option(x + 1)) // Some(2)
for { a <- Option(1); b <- Option(2) } yield a + bAdvertisement
How it works
Not all types are monads. Semantic laws.
Advertisement
Trade-offs + gotchas
Compositional error handling, async, collections.