object EitherT extends EitherTInstances with Serializable
- Alphabetic
- By Inheritance
- EitherT
- Serializable
- Serializable
- EitherTInstances
- EitherTInstances1
- EitherTInstances2
- EitherTInstances3
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
implicit
def
catsDataBifunctorForEitherT[F[_]](implicit F: Functor[F]): Bifunctor[[β$13$, γ$14$]EitherT[F, β$13$, γ$14$]]
- Definition Classes
- EitherTInstances
-
implicit
def
catsDataBitraverseForEitherT[F[_]](implicit F: Traverse[F]): Bitraverse[[β$19$, γ$20$]EitherT[F, β$19$, γ$20$]]
- Definition Classes
- EitherTInstances1
-
implicit
def
catsDataDeferForEitherT[F[_], L](implicit F: Defer[F]): Defer[[γ$16$]EitherT[F, L, γ$16$]]
- Definition Classes
- EitherTInstances
-
implicit
def
catsDataEqForEitherT[F[_], L, R](implicit F: Eq[F[Either[L, R]]]): Eq[EitherT[F, L, R]]
- Definition Classes
- EitherTInstances2
-
implicit
def
catsDataFoldableForEitherT[F[_], L](implicit F: Foldable[F]): Foldable[[γ$18$]EitherT[F, L, γ$18$]]
- Definition Classes
- EitherTInstances1
-
implicit
def
catsDataFunctorForEitherT[F[_], L](implicit F0: Functor[F]): Functor[[γ$24$]EitherT[F, L, γ$24$]]
- Definition Classes
- EitherTInstances3
-
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
-
implicit
def
catsDataMonadErrorForEitherT[F[_], L](implicit F0: Monad[F]): MonadError[[γ$21$]EitherT[F, L, γ$21$], L]
- Definition Classes
- EitherTInstances1
-
implicit
def
catsDataOrderForEitherT[F[_], L, R](implicit F: Order[F[Either[L, R]]]): Order[EitherT[F, L, R]]
- Definition Classes
- EitherTInstances
-
implicit
def
catsDataPartialOrderForEitherT[F[_], L, R](implicit F: PartialOrder[F[Either[L, R]]]): PartialOrder[EitherT[F, L, R]]
- Definition Classes
- EitherTInstances1
-
implicit
def
catsDataSemigroupKForEitherT[F[_], L](implicit F0: Monad[F]): SemigroupK[[γ$23$]EitherT[F, L, γ$23$]]
- Definition Classes
- EitherTInstances2
-
implicit
def
catsDataShowForEitherT[F[_], L, R](implicit sh: Show[F[Either[L, R]]]): Show[EitherT[F, L, R]]
- Definition Classes
- EitherTInstances
-
implicit
def
catsDataTraverseForEitherT[F[_], L](implicit FF: Traverse[F]): Traverse[[γ$15$]EitherT[F, L, γ$15$]]
- Definition Classes
- EitherTInstances
-
implicit
def
catsMonoidForEitherT[F[_], L, A](implicit F: Monoid[F[Either[L, A]]]): Monoid[EitherT[F, L, A]]
- Definition Classes
- EitherTInstances
-
implicit
def
catsSemigroupForEitherT[F[_], L, A](implicit F: Semigroup[F[Either[L, A]]]): Semigroup[EitherT[F, L, A]]
- Definition Classes
- EitherTInstances1
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
cond[F[_]]: CondPartiallyApplied[F]
If the condition is satisfied, return the given
A
inRight
lifted into the specifiedApplicative
, otherwise, return the givenE
inLeft
lifted into the specifiedApplicative
.If the condition is satisfied, return the given
A
inRight
lifted into the specifiedApplicative
, otherwise, return the givenE
inLeft
lifted into the specifiedApplicative
.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))
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
fromEither[F[_]]: FromEitherPartiallyApplied[F]
Transforms an
Either
into anEitherT
, lifted into the specifiedApplicative
.Transforms an
Either
into anEitherT
, lifted into the specifiedApplicative
.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.
-
final
def
fromOption[F[_]]: FromOptionPartiallyApplied[F]
Transforms an
Option
into anEitherT
, lifted into the specifiedApplicative
and using the second argument if theOption
is aNone
.Transforms an
Option
into anEitherT
, lifted into the specifiedApplicative
and using the second argument if theOption
is aNone
.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)))
-
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 anEitherT
, using the second argument if theOption
is aNone
.Transforms an
F[Option]
into anEitherT
, using the second argument if theOption
is aNone
.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)))
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
left[B]: LeftPartiallyApplied[B]
Creates a left version of
EitherT[F, A, B]
from aF[A]
Creates a left version of
EitherT[F, A, B]
from aF[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)))
-
final
def
leftT[F[_], B]: LeftTPartiallyApplied[F, B]
Creates a left version of
EitherT[F, A, B]
from aA
Creates a left version of
EitherT[F, A, B]
from aA
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)))
-
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)
-
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))
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
pure[F[_], A]: PurePartiallyApplied[F, A]
Creates a new
EitherT[F, A, B]
from aB
Creates a new
EitherT[F, A, B]
from aB
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)))
-
final
def
right[A]: RightPartiallyApplied[A]
Creates a right version of
EitherT[F, A, B]
from aF[B]
Creates a right version of
EitherT[F, A, B]
from aF[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)))
-
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)))
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )