ogatatsu
11/21/2011 - 11:29 AM

RichEither

RichEither

class RichEither[A](e: Either[Throwable, A]) {
  def success: A = e match {
    case Right(r) => r
    case Left(l) => throw l
  }
}
implicit def eitherWrapper[A](e: Either[Throwable, A]) = new RichEither(e)