object IorT extends IorTInstances with Serializable
- Source
- IorT.scala
- Alphabetic
- By Inheritance
- IorT
- Serializable
- IorTInstances
- IorTInstances1
- IorTInstances2
- IorTInstances3
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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
- def accumulatingParallel[M[_], E](implicit P: Parallel[M], E: Semigroup[E]): Aux[[γ$13$]IorT[M, E, γ$13$], [γ$14$]IorT[Parallel.F, E, γ$14$]]
An alternative Parallel implementation which merges the semantics of the outer Parallel (the F[_] effect) with the effects of the inner one (the Ior).
An alternative Parallel implementation which merges the semantics of the outer Parallel (the F[_] effect) with the effects of the inner one (the Ior). The inner Parallel has the semantics of Ior's Parallel, while the outer has the semantics of parallel evaluation (in most cases). The default Parallel for IorT, when the nested F also has a Parallel, is to strictly take the semantics of the nested F and to short-circuit any lefts (often, errors) in a left-to-right fashion, mirroring the semantics of Applicative on IorT. This instance is different in that it will not short-circuit but instead accumulate all lefts according to the supplied Semigroup.
implicit val p: Parallel[IorT[IO, Chain[Error], *]] = IorT.accumulatingParallel val a = IorT(IO(Chain(error1).leftIor[Unit])) val b = IorT(IO(Chain(error2).leftIor[Unit])) (a, b).parTupled // => IorT(IO(Chain(error1, error2).leftIor[Unit]))
- Definition Classes
- IorTInstances
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- final def both[F[_], A, B](fa: F[A], fb: F[B])(implicit F: Apply[F]): IorT[F, A, B]
Creates a both version of
IorT[F, A, B]
from aF[A]
and aF[B]
Creates a both version of
IorT[F, A, B]
from aF[A]
and aF[B]
scala> import cats.data.IorT scala> import cats.implicits._ scala> IorT.both(Option("err"), Option(3)) res0: cats.data.IorT[Option,String,Int] = IorT(Some(Both(err,3)))
- final def bothT[F[_]]: BothTPartiallyApplied[F]
Creates a both version of
IorT[F, A, B]
from aA
and aB
Creates a both version of
IorT[F, A, B]
from aA
and aB
scala> import cats.data.IorT scala> import cats.implicits._ scala> IorT.bothT[Option]("err", 3) res0: cats.data.IorT[Option,String,Int] = IorT(Some(Both(err,3)))
- implicit def catsDataBifunctorForIorT[F[_]](implicit F: Functor[F]): Bifunctor[[β$8$, γ$9$]IorT[F, β$8$, γ$9$]]
- Definition Classes
- IorTInstances
- implicit def catsDataDeferForIor[F[_], E](implicit F: Defer[F]): Defer[[γ$47$]IorT[F, E, γ$47$]]
- Definition Classes
- IorTInstances
- implicit def catsDataEqForIorT[F[_], A, B](implicit F: Eq[F[Ior[A, B]]]): Eq[IorT[F, A, B]]
- Definition Classes
- IorTInstances2
- implicit def catsDataFoldableForIorT[F[_], A](implicit F: Foldable[F]): Foldable[[γ$49$]IorT[F, A, γ$49$]]
- Definition Classes
- IorTInstances1
- implicit def catsDataFunctorForIorT[F[_], A](implicit F: Functor[F]): Functor[[γ$67$]IorT[F, A, γ$67$]]
- Definition Classes
- IorTInstances3
- implicit def catsDataMonadErrorFForIorT[F[_], A, E](implicit FE: MonadError[F, E], A: Semigroup[A]): MonadError[[γ$66$]IorT[F, A, γ$66$], E]
- Definition Classes
- IorTInstances2
- implicit def catsDataMonadErrorForIorT[F[_], A](implicit F: Monad[F], A: Semigroup[A]): MonadError[[γ$50$]IorT[F, A, γ$50$], A]
- Definition Classes
- IorTInstances1
- implicit def catsDataMonoidForIorT[F[_], A, B](implicit F: Monoid[F[Ior[A, B]]]): Monoid[IorT[F, A, B]]
- Definition Classes
- IorTInstances
- implicit def catsDataOrderForIorT[F[_], A, B](implicit F: Order[F[Ior[A, B]]]): Order[IorT[F, A, B]]
- Definition Classes
- IorTInstances1
- implicit def catsDataParallelForIorTWithParallelEffect[M[_], E](implicit P: Parallel[M], E: Semigroup[E]): Aux[[γ$31$]IorT[M, E, γ$31$], [γ$32$]IorT[Parallel.F, E, γ$32$]] { type Dummy }
- Definition Classes
- IorTInstances
- implicit def catsDataParallelForIorTWithSequentialEffect[F0[_], E](implicit F: Monad[F0], E: Semigroup[E]): Aux[[γ$51$]IorT[F0, E, γ$51$], [γ$52$]IorT[F0, E, γ$52$]]
- Definition Classes
- IorTInstances1
- implicit def catsDataSemigroupForIorT[F[_], A, B](implicit F: Semigroup[F[Ior[A, B]]]): Semigroup[IorT[F, A, B]]
- Definition Classes
- IorTInstances1
- implicit def catsDataShowForIorT[F[_], A, B](implicit sh: Show[F[Ior[A, B]]]): Show[IorT[F, A, B]]
- Definition Classes
- IorTInstances
- implicit def catsDataTraverseForIorT[F[_], A](implicit F: Traverse[F]): Traverse[[γ$12$]IorT[F, A, γ$12$]]
- Definition Classes
- IorTInstances
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def cond[F[_]]: CondPartiallyApplied[F]
If the condition is satisfied, return the given
B
inIor.Right
, otherwise, return the givenA
inIor.Left
, lifted into the specifiedApplicative
.If the condition is satisfied, return the given
B
inIor.Right
, otherwise, return the givenA
inIor.Left
, lifted into the specifiedApplicative
.scala> import cats.data.IorT scala> import cats.implicits._ scala> val userInput = "hello world" scala> IorT.cond[Option]( | userInput.forall(_.isDigit) && userInput.size == 10, | userInput, | "The input does not look like a phone number") res0: cats.data.IorT[Option,String,String] = IorT(Some(Left(The input does not look like a phone number)))
- final def condF[F[_], A, B](test: Boolean, right: => F[B], left: => F[A])(implicit F: Functor[F]): IorT[F, A, B]
If the condition is satisfied, return the value of
IorT.right
onF[B]
, otherwise, return the value ofIorT.left
onF[A]
.If the condition is satisfied, return the value of
IorT.right
onF[B]
, otherwise, return the value ofIorT.left
onF[A]
.scala> import cats.data.IorT scala> import cats.implicits._ scala> val userInput = "hello world" scala> IorT.condF[Option, String, String]( | userInput.forall(_.isDigit) && userInput.size == 10, | Some(userInput), | None) res0: cats.data.IorT[Option,String,String] = IorT(None)
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def fromEither[F[_]]: FromEitherPartiallyApplied[F]
Transforms an
Either
into anIorT
, lifted into the specifiedApplicative
.Transforms an
Either
into anIorT
, lifted into the specifiedApplicative
.scala> import cats.data.IorT scala> import cats.implicits._ scala> val e: Either[String, Int] = Either.right(3) scala> IorT.fromEither[Option](e) res0: cats.data.IorT[Option,String,Int] = IorT(Some(Right(3)))
- final def fromEitherF[F[_], E, A](feither: F[Either[E, A]])(implicit F: Functor[F]): IorT[F, E, A]
Transforms an
F[Either]
into anIorT
.Transforms an
F[Either]
into anIorT
.scala> import cats.data.IorT scala> import cats.implicits._ scala> val e: Either[String, Int] = Either.right(3) scala> IorT.fromEitherF(Option(e)) res0: cats.data.IorT[Option,String,Int] = IorT(Some(Right(3)))
- final def fromIor[F[_]]: FromIorPartiallyApplied[F]
Transforms an
Ior
into anIorT
, lifted into the specifiedApplicative
.Transforms an
Ior
into anIorT
, lifted into the specifiedApplicative
.scala> import cats.data.{IorT, Ior} scala> import cats.implicits._ scala> val i: Ior[String, Int] = Ior.both("warning", 3) scala> IorT.fromIor[Option](i) res0: cats.data.IorT[Option,String,Int] = IorT(Some(Both(warning,3)))
- final def fromOption[F[_]]: FromOptionPartiallyApplied[F]
Transforms an
Option
into anIorT
, lifted into the specifiedApplicative
and using the second argument if theOption
is aNone
.Transforms an
Option
into anIorT
, lifted into the specifiedApplicative
and using the second argument if theOption
is aNone
.scala> import cats.data.IorT scala> import cats.implicits._ scala> val o: Option[Int] = None scala> IorT.fromOption[List](o, "Answer not known.") res0: cats.data.IorT[List,String,Int] = IorT(List(Left(Answer not known.))) scala> IorT.fromOption[List](Some(42), "Answer not known.") res1: cats.data.IorT[List,String,Int] = IorT(List(Right(42)))
- final def fromOptionF[F[_], E, A](foption: F[Option[A]], ifNone: => E)(implicit F: Functor[F]): IorT[F, E, A]
Transforms an
F[Option]
into anIorT
, using the second argument if theOption
is aNone
.Transforms an
F[Option]
into anIorT
, using the second argument if theOption
is aNone
.scala> import cats.data.IorT scala> import cats.implicits._ scala> val o: Option[Int] = None scala> IorT.fromOptionF(List(o), "Answer not known.") res0: cats.data.IorT[List,String,Int] = IorT(List(Left(Answer not known.))) scala> IorT.fromOptionF(List(Option(42)), "Answer not known.") res1: cats.data.IorT[List,String,Int] = IorT(List(Right(42)))
- final def fromOptionM[F[_], E, A](foption: F[Option[A]], ifNone: => F[E])(implicit F: Monad[F]): IorT[F, E, A]
Similar to
fromOptionF
but the left is carried from monadicF[_]
context when the option isNone
- final def getClass(): Class[_ <: AnyRef]
- 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
IorT[F, A, B]
from aF[A]
Creates a left version of
IorT[F, A, B]
from aF[A]
scala> import cats.data.IorT scala> import cats.implicits._ scala> IorT.left[Int](Option("err")) res0: cats.data.IorT[Option,String,Int] = IorT(Some(Left(err)))
- final def leftT[F[_], B]: LeftTPartiallyApplied[F, B]
Creates a left version of
IorT[F, A, B]
from aA
Creates a left version of
IorT[F, A, B]
from aA
scala> import cats.data.IorT scala> import cats.implicits._ scala> IorT.leftT[Option, Int]("err") res0: cats.data.IorT[Option,String,Int] = IorT(Some(Left(err)))
- final def liftF[F[_], A, B](fb: F[B])(implicit F: Applicative[F]): IorT[F, A, B]
Alias for right
Alias for right
scala> import cats.data.IorT scala> import cats.implicits._ scala> val o: Option[Int] = Some(3) scala> val n: Option[Int] = None scala> IorT.liftF(o) res0: cats.data.IorT[Option,Nothing,Int] = IorT(Some(Right(3))) scala> IorT.liftF(n) res1: cats.data.IorT[Option,Nothing,Int] = IorT(None)
- final def liftK[F[_], A](implicit F: Functor[F]): ~>[F, [γ$6$]IorT[F, A, γ$6$]]
Same as liftF, but expressed as a FunctionK for use with IorT.mapK
Same as liftF, but expressed as a FunctionK for use with IorT.mapK
scala> import cats._, data._, implicits._ scala> val a: OptionT[Eval, Int] = 1.pure[OptionT[Eval, *]] scala> val b: OptionT[IorT[Eval, String, *], Int] = a.mapK(IorT.liftK) scala> b.value.value.value res0: cats.data.Ior[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 right version of
IorT[F, A, B]
from aB
Creates a right version of
IorT[F, A, B]
from aB
scala> import cats.data.IorT scala> import cats.implicits._ scala> IorT.pure[Option, String](3) res0: cats.data.IorT[Option,String,Int] = IorT(Some(Right(3)))
- final def right[A]: RightPartiallyApplied[A]
Creates a right version of
IorT[F, A, B]
from aF[B]
Creates a right version of
IorT[F, A, B]
from aF[B]
scala> import cats.data.IorT scala> import cats.implicits._ scala> IorT.right[String](Option(3)) res0: cats.data.IorT[Option,String,Int] = IorT(Some(Right(3)))
- final def rightT[F[_], A]: PurePartiallyApplied[F, A]
Alias for pure
Alias for pure
scala> import cats.data.IorT scala> import cats.implicits._ scala> IorT.rightT[Option, String](3) res0: cats.data.IorT[Option,String,Int] = IorT(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(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()