Advertisement
Guest User

Untitled

a guest
May 23rd, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.27 KB | None | 0 0
  1. val x = {
  2.     val x = read()       // Return Either[Exception, String]
  3.     if (x.isLeft) {      
  4.         foo(x.left.get)  // foo expects a Exception, and will exit(1) once its done.
  5.     }
  6.     x.right.get          // We need x to be of type String since it is used later on
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement