Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object Example
- def foo(x: Int): Either[Exception, Int] = ... etc
- def bar(x: Int): Either[Exception, Int] = ... etc
- def baz(x: Int): Either[Exception, Int] = ... etc
- def qux(x: Int): Either[Exception, Int] = ... etc
- ...etc
- def main(args: Array[String]): Unit = {
- val x = foo(1) match {
- case Right(x) => x
- case Left(e) => return
- }
- val y = bar(x) match {
- case Right(y) => y
- case Left(e) => return
- }
- val z = baz(y) match {
- case Right(z) => z
- case Left(e) => return
- }
- val a = foo(z) match {
- case Right(a) => a
- case Left(e) => return
- }
- ...etc
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement