object EitherT extends EitherTInstances with Serializable

Source
EitherT.scala
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
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. implicit def catsDataBifunctorForEitherT[F[_]](implicit F: Functor[F]): Bifunctor[[β$13$, γ$14$]EitherT[F, β$13$, γ$14$]]
    Definition Classes
    EitherTInstances
  6. implicit def catsDataBitraverseForEitherT[F[_]](implicit F: Traverse[F]): Bitraverse[[β$19$, γ$20$]EitherT[F, β$19$, γ$20$]]
    Definition Classes
    EitherTInstances1
  7. implicit def catsDataDeferForEitherT[F[_], L](implicit F: Defer[F]): Defer[[γ$16$]EitherT[F, L, γ$16$]]
    Definition Classes
    EitherTInstances
  8. implicit def catsDataEqForEitherT[F[_], L, R](implicit F: Eq[F[Either[L, R]]]): Eq[EitherT[F, L, R]]
    Definition Classes
    EitherTInstances2
  9. implicit def catsDataFoldableForEitherT[F[_], L](implicit F: Foldable[F]): Foldable[[γ$18$]EitherT[F, L, γ$18$]]
    Definition Classes
    EitherTInstances1
  10. implicit def catsDataFunctorForEitherT[F[_], L](implicit F0: Functor[F]): Functor[[γ$24$]EitherT[F, L, γ$24$]]
    Definition Classes
    EitherTInstances3
  11. implicit def catsDataMonadErrorFForEitherT[F[_], E, L](implicit FE0: MonadError[F, E]): MonadError[[γ$22$]EitherT[F, L, γ$22$], E]

    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]
    Definition Classes
    EitherTInstances1
  13. implicit def catsDataOrderForEitherT[F[_], L, R](implicit F: Order[F[Either[L, R]]]): Order[EitherT[F, L, R]]
    Definition Classes
    EitherTInstances
  14. implicit def catsDataPartialOrderForEitherT[F[_], L, R](implicit F: PartialOrder[F[Either[L, R]]]): PartialOrder[EitherT[F, L, R]]
    Definition Classes
    EitherTInstances1
  15. implicit def catsDataSemigroupKForEitherT[F[_], L](implicit F0: Monad[F]): SemigroupK[[γ$23$]EitherT[F, L, γ$23$]]
    Definition Classes
    EitherTInstances2
  16. implicit def catsDataShowForEitherT[F[_], L, R](implicit sh: Show[F[Either[L, R]]]): Show[EitherT[F, L, R]]
    Definition Classes
    EitherTInstances
  17. implicit def catsDataTraverseForEitherT[F[_], L](implicit FF: Traverse[F]): Traverse[[γ$15$]EitherT[F, L, γ$15$]]
    Definition Classes
    EitherTInstances
  18. implicit def catsMonoidForEitherT[F[_], L, A](implicit F: Monoid[F[Either[L, A]]]): Monoid[EitherT[F, L, A]]
    Definition Classes
    EitherTInstances
  19. implicit def catsSemigroupForEitherT[F[_], L, A](implicit F: Semigroup[F[Either[L, A]]]): Semigroup[EitherT[F, L, A]]
    Definition Classes
    EitherTInstances1
  20. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  21. final def cond[F[_]]: CondPartiallyApplied[F]

    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
    Definition Classes
    AnyRef
  23. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  24. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. final def fromEither[F[_]]: FromEitherPartiallyApplied[F]

    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]

    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]

    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[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  29. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  30. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  31. final def left[B]: LeftPartiallyApplied[B]

    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]

    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]

    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$]]

    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
    Definition Classes
    AnyRef
  36. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  37. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  38. final def pure[F[_], A]: PurePartiallyApplied[F, A]

    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]

    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]

    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
    Definition Classes
    AnyRef
  42. def toString(): String
    Definition Classes
    AnyRef → Any
  43. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Deprecated Value Members

  1. final def liftT[F[_], A, B](fb: F[B])(implicit F: Functor[F]): EitherT[F, A, B]
    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