Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val f1: Future[Either[Error, Int]] = ???
- val f2: Future[Either[Error, Int]] = ???
- val f3(x: Int, y: Int): Future[String] = ???
- val eitherT = for {
- x <- EitherT(f1)
- y <- EitherT(f2)
- z <- EitherT(f2(x, y).map(_.asRight[Error]))
- } yield z
- eitherT.value // Future[Either[Error, String]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement