final class EitherObjectOps extends AnyVal
- Alphabetic
- By Inheritance
- EitherObjectOps
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new EitherObjectOps(either: Either.type)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def catchNonFatal[A](f: ⇒ A): Either[Throwable, A]
-
def
catchOnly[T >: Null <: Throwable]: CatchOnlyPartiallyApplied[T]
Evaluates the specified block, catching exceptions of the specified type and returning them on the left side of the resulting
Either
.Evaluates the specified block, catching exceptions of the specified type and returning them on the left side of the resulting
Either
. Uncaught exceptions are propagated.For example:
scala> import cats.implicits._ // get syntax for Either scala> Either.catchOnly[NumberFormatException] { "foo".toInt } res0: Either[NumberFormatException, Int] = Left(java.lang.NumberFormatException: For input string: "foo")
-
def
fromOption[A, B](o: Option[B], ifNone: ⇒ A): Either[A, B]
Converts an
Option[B]
to anEither[A, B]
, where the providedifNone
values is returned on the left of theEither
when the specifiedOption
isNone
. -
def
fromTry[A](t: Try[A]): Either[Throwable, A]
Converts a
Try[A]
to aEither[Throwable, A]
. -
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def left[A, B](a: A): Either[A, B]
- def leftNec[A, B](a: A): EitherNec[A, B]
- def leftNel[A, B](a: A): EitherNel[A, B]
- def leftNes[A, B](a: A)(implicit O: Order[A]): EitherNes[A, B]
- def right[A, B](b: B): Either[A, B]
- def rightNec[A, B](b: B): EitherNec[A, B]
- def rightNel[A, B](b: B): EitherNel[A, B]
- def rightNes[A, B](b: B)(implicit O: Order[B]): EitherNes[A, B]
-
def
toString(): String
- Definition Classes
- Any
-
def
unit[A]: Either[A, Unit]
Cached value of
Right(())
to avoid allocations for a common case.