Using Either to process failures in Scala code
Either is used to return one of possible two meaningful results, unlike Option which is used to return a single meaningful result or nothing. An easy to understand example is given below (circulated on the Scala mailing list a while back): def throwableToLeft[T](block: => T): Either[java.lang.Throwable, T] = try { Right(block) } catch { case … Read more