Practical Monads: Dealing with Futures of Options
Matt Fowler

Can’t we do something like this ? (sorry haven’t tested it)

  • Seq(first,second) is a Seq[Future[Option[Int]]
  • Future.sequence(…) is a Future[Seq[Option[Int]]
  • ….map(_.flatten()) is a Future[Seq[Int]
  • (….sum()) is a Future[Int]
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.