Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val t1 = Try("hello")
- val t2 = Try(throw new Exception("let's fail instead"))
- val t3 = Try("world")
- val t4 = t1.flatMap(a => t2.flatMap(b => t3.map(c => a + " " + c)))
- // t4: scala.util.Try[String] = Failure(java.lang.Exception: let's fail instead)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement