Guest User

Untitled

a guest
May 15th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.22 KB | None | 0 0
  1. scala> val a, b: Either[String, Int] = Right(1)
  2. a: Either[String,Int] = Right(1)
  3. b: Either[String,Int] = Right(1)
  4.  
  5. scala> for { aa <- a.right
  6.      | bb <- b.right
  7.      | } yield aa + bb
  8. res4: Either[String,Int] = Right(2)
Add Comment
Please, Sign In to add comment