Object/Class

cats.data

EitherT

Related Docs: class EitherT | package data

Permalink

object EitherT extends EitherTInstances with Serializable

Linear Supertypes
Serializable, Serializable, EitherTInstances, EitherTInstances1, EitherTInstances2, EitherTInstances3, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EitherT
  2. Serializable
  3. Serializable
  4. EitherTInstances
  5. EitherTInstances1
  6. EitherTInstances2
  7. EitherTInstances3
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. implicit def catsDataBifunctorForEitherT[F[_]](implicit F: Functor[F]): Bifunctor[[β$13$, γ$14$]EitherT[F, β$13$, γ$14$]]

    Permalink
    Definition Classes
    EitherTInstances
  6. implicit def catsDataBitraverseForEitherT[F[_]](implicit F: Traverse[F]): Bitraverse[[β$19$, γ$20$]EitherT[F, β$19$, γ$20$]]

    Permalink
    Definition Classes
    EitherTInstances1
  7. implicit def catsDataDeferForEitherT[F[_], L](implicit F: Defer[F]): Defer[[γ$16$]EitherT[F, L, γ$16$]]

    Permalink
    Definition Classes
    EitherTInstances
  8. implicit def catsDataEqForEitherT[F[_], L, R](implicit F: Eq[F[Either[L, R]]]): Eq[EitherT[F, L, R]]

    Permalink
    Definition Classes
    EitherTInstances2
  9. implicit def catsDataFoldableForEitherT[F[_], L](implicit F: Foldable[F]): Foldable[[γ$18$]EitherT[F, L, γ$18$]]

    Permalink
    Definition Classes
    EitherTInstances1
  10. implicit def catsDataFunctorForEitherT[F[_], L](implicit F0: Functor[F]): Functor[[γ$24$]EitherT[F, L, γ$24$]]

    Permalink
    Definition Classes
    EitherTInstances3
  11. implicit def catsDataMonadErrorFForEitherT[F[_], E, L](implicit FE0: MonadError[F, E]): MonadError[[γ$22$]EitherT[F, L, γ$22$], E]

    Permalink

    Monad error instance for recovering errors in F instead of the underlying Either.

    Monad error instance for recovering errors in F instead of the underlying Either.

    scala> import cats.data.EitherT
    scala> import cats.MonadError
    scala> import cats.instances.option._
    scala> val noInt: Option[Either[String, Int]] = None
    scala> val et = EitherT[Option, String, Int](noInt)
    scala> val me = MonadError[EitherT[Option, String, ?], Unit]
    scala> me.recover(et) { case () => 1 }
    res0: cats.data.EitherT[Option,String,Int] = EitherT(Some(Right(1)))
    Definition Classes
    EitherTInstances2
  12. implicit def catsDataMonadErrorForEitherT[F[_], L](implicit F0: Monad[F]): MonadError[[γ$21$]EitherT[F, L, γ$21$], L]

    Permalink
    Definition Classes
    EitherTInstances1
  13. implicit def catsDataOrderForEitherT[F[_], L, R](implicit F: Order[F[Either[L, R]]]): Order[EitherT[F, L, R]]

    Permalink
    Definition Classes
    EitherTInstances
  14. implicit def catsDataPartialOrderForEitherT[F[_], L, R](implicit F: PartialOrder[F[Either[L, R]]]): PartialOrder[EitherT[F, L, R]]

    Permalink
    Definition Classes
    EitherTInstances1
  15. implicit def catsDataSemigroupKForEitherT[F[_], L](implicit F0: Monad[F]): SemigroupK[[γ$23$]EitherT[F, L, γ$23$]]

    Permalink
    Definition Classes
    EitherTInstances2
  16. implicit def catsDataShowForEitherT[F[_], L, R](implicit sh: Show[F[Either[L, R]]]): Show[EitherT[F, L, R]]

    Permalink
    Definition Classes
    EitherTInstances
  17. implicit def catsDataTraverseForEitherT[F[_], L](implicit FF: Traverse[F]): Traverse[[γ$15$]EitherT[F, L, γ$15$]]

    Permalink
    Definition Classes
    EitherTInstances
  18. implicit def catsMonoidForEitherT[F[_], L, A](implicit F: Monoid[F[Either[L, A]]]): Monoid[EitherT[F, L, A]]

    Permalink
    Definition Classes
    EitherTInstances
  19. implicit def catsSemigroupForEitherT[F[_], L, A](implicit F: Semigroup[F[Either[L, A]]]): Semigroup[EitherT[F, L, A]]

    Permalink
    Definition Classes
    EitherTInstances1
  20. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def cond[F[_]]: CondPartiallyApplied[F]

    Permalink

    If the condition is satisfied, return the given A in Right lifted into the specified Applicative, otherwise, return the given E in Left lifted into the specified Applicative.

    If the condition is satisfied, return the given A in Right lifted into the specified Applicative, otherwise, return the given E in Left lifted into the specified Applicative.

    scala> import cats.Id
    scala> import cats.data.EitherT
    scala> val userInput = "hello world"
    scala> EitherT.cond[Id](
         |   userInput.forall(_.isDigit) && userInput.size == 10,
         |   userInput,
         |   "The input does not look like a phone number")
    res0: EitherT[Id, String, String] = EitherT(Left(The input does not look like a phone number))
  22. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  24. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. final def fromEither[F[_]]: FromEitherPartiallyApplied[F]

    Permalink

    Transforms an Either into an EitherT, lifted into the specified Applicative.

    Transforms an Either into an EitherT, lifted into the specified Applicative.

    Note: The return type is a FromEitherPartiallyApplied[F], which has an apply method on it, allowing you to call fromEither like this:

    scala> import cats.implicits._
    scala> val t: Either[String, Int] = Either.right(3)
    scala> EitherT.fromEither[Option](t)
    res0: EitherT[Option, String, Int] = EitherT(Some(Right(3)))

    The reason for the indirection is to emulate currying type parameters.

  26. final def fromOption[F[_]]: FromOptionPartiallyApplied[F]

    Permalink

    Transforms an Option into an EitherT, lifted into the specified Applicative and using the second argument if the Option is a None.

    Transforms an Option into an EitherT, lifted into the specified Applicative and using the second argument if the Option is a None.

    scala> import cats.implicits._
    scala> val o: Option[Int] = None
    scala> EitherT.fromOption[List](o, "Answer not known.")
    res0: EitherT[List, String, Int]  = EitherT(List(Left(Answer not known.)))
    scala> EitherT.fromOption[List](Some(42), "Answer not known.")
    res1: EitherT[List, String, Int] = EitherT(List(Right(42)))
  27. final def fromOptionF[F[_], E, A](fopt: F[Option[A]], ifNone: ⇒ E)(implicit F: Functor[F]): EitherT[F, E, A]

    Permalink

    Transforms an F[Option] into an EitherT, using the second argument if the Option is a None.

    Transforms an F[Option] into an EitherT, using the second argument if the Option is a None.

    scala> import cats.implicits._
    scala> val o: Option[Int] = None
    scala> EitherT.fromOptionF(List(o), "Answer not known.")
    res0: EitherT[List, String, Int]  = EitherT(List(Left(Answer not known.)))
    scala> EitherT.fromOptionF(List(Option(42)), "Answer not known.")
    res1: EitherT[List, String, Int] = EitherT(List(Right(42)))
  28. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  29. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  30. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  31. final def left[B]: LeftPartiallyApplied[B]

    Permalink

    Creates a left version of EitherT[F, A, B] from a F[A]

    Creates a left version of EitherT[F, A, B] from a F[A]

    scala> import cats.data.EitherT
    scala> import cats.implicits._
    scala> EitherT.left[Int](Option("err"))
    res0: cats.data.EitherT[Option,String,Int] = EitherT(Some(Left(err)))
  32. final def leftT[F[_], B]: LeftTPartiallyApplied[F, B]

    Permalink

    Creates a left version of EitherT[F, A, B] from a A

    Creates a left version of EitherT[F, A, B] from a A

    scala> import cats.data.EitherT
    scala> import cats.implicits._
    scala> EitherT.leftT[Option, Int]("err")
    res0: cats.data.EitherT[Option,String,Int] = EitherT(Some(Left(err)))
  33. final def liftF[F[_], A, B](fb: F[B])(implicit F: Functor[F]): EitherT[F, A, B]

    Permalink

    Alias for right

    Alias for right

    scala> import cats.data.EitherT
    scala> import cats.implicits._
    scala> val o: Option[Int] = Some(3)
    scala> val n: Option[Int] = None
    scala> EitherT.liftF(o)
    res0: cats.data.EitherT[Option,Nothing,Int] = EitherT(Some(Right(3)))
    scala> EitherT.liftF(n)
    res1: cats.data.EitherT[Option,Nothing,Int] = EitherT(None)
  34. final def liftK[F[_], A](implicit F: Functor[F]): ~>[F, [γ$10$]EitherT[F, A, γ$10$]]

    Permalink

    Same as liftF, but expressed as a FunctionK for use with mapK

    Same as liftF, but expressed as a FunctionK for use with mapK

    scala> import cats._, data._, implicits._
    scala> val a: OptionT[Eval, Int] = 1.pure[OptionT[Eval, ?]]
    scala> val b: OptionT[EitherT[Eval, String, ?], Int] = a.mapK(EitherT.liftK)
    scala> b.value.value.value
    res0: Either[String,Option[Int]] = Right(Some(1))
  35. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  36. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  37. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  38. final def pure[F[_], A]: PurePartiallyApplied[F, A]

    Permalink

    Creates a new EitherT[F, A, B] from a B

    Creates a new EitherT[F, A, B] from a B

    scala> import cats.data.EitherT
    scala> import cats.implicits._
    scala> EitherT.pure[Option, String](3)
    res0: cats.data.EitherT[Option,String,Int] = EitherT(Some(Right(3)))
  39. final def right[A]: RightPartiallyApplied[A]

    Permalink

    Creates a right version of EitherT[F, A, B] from a F[B]

    Creates a right version of EitherT[F, A, B] from a F[B]

    scala> import cats.data.EitherT
    scala> import cats.implicits._
    scala> EitherT.right[String](Option(3))
    res0: cats.data.EitherT[Option,String,Int] = EitherT(Some(Right(3)))
  40. final def rightT[F[_], A]: PurePartiallyApplied[F, A]

    Permalink

    Alias for pure

    Alias for pure

    scala> import cats.data.EitherT
    scala> import cats.implicits._
    scala> EitherT.rightT[Option, String](3)
    res0: cats.data.EitherT[Option,String,Int] = EitherT(Some(Right(3)))
  41. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  42. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  43. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. final def liftT[F[_], A, B](fb: F[B])(implicit F: Functor[F]): EitherT[F, A, B]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0-RC1) Use EitherT.liftF.

Inherited from Serializable

Inherited from Serializable

Inherited from EitherTInstances

Inherited from EitherTInstances1

Inherited from EitherTInstances2

Inherited from EitherTInstances3

Inherited from AnyRef

Inherited from Any

Ungrouped