Packages

object IorT extends IorTInstances with Serializable

Source
IorT.scala
Linear Supertypes
Serializable, Serializable, IorTInstances, IorTInstances1, IorTInstances2, IorTInstances3, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. IorT
  2. Serializable
  3. Serializable
  4. IorTInstances
  5. IorTInstances1
  6. IorTInstances2
  7. IorTInstances3
  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. 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
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. 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 a F[A] and a F[B]

    Creates a both version of IorT[F, A, B] from a F[A] and a F[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)))
  7. final def bothT[F[_]]: BothTPartiallyApplied[F]

    Creates a both version of IorT[F, A, B] from a A and a B

    Creates a both version of IorT[F, A, B] from a A and a B

    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)))
  8. implicit def catsDataBifunctorForIorT[F[_]](implicit F: Functor[F]): Bifunctor[[β$8$, γ$9$]IorT[F, β$8$, γ$9$]]
    Definition Classes
    IorTInstances
  9. implicit def catsDataDeferForIor[F[_], E](implicit F: Defer[F]): Defer[[γ$47$]IorT[F, E, γ$47$]]
    Definition Classes
    IorTInstances
  10. implicit def catsDataEqForIorT[F[_], A, B](implicit F: Eq[F[Ior[A, B]]]): Eq[IorT[F, A, B]]
    Definition Classes
    IorTInstances2
  11. implicit def catsDataFoldableForIorT[F[_], A](implicit F: Foldable[F]): Foldable[[γ$49$]IorT[F, A, γ$49$]]
    Definition Classes
    IorTInstances1
  12. implicit def catsDataFunctorForIorT[F[_], A](implicit F: Functor[F]): Functor[[γ$67$]IorT[F, A, γ$67$]]
    Definition Classes
    IorTInstances3
  13. implicit def catsDataMonadErrorFForIorT[F[_], A, E](implicit FE: MonadError[F, E], A: Semigroup[A]): MonadError[[γ$66$]IorT[F, A, γ$66$], E]
    Definition Classes
    IorTInstances2
  14. implicit def catsDataMonadErrorForIorT[F[_], A](implicit F: Monad[F], A: Semigroup[A]): MonadError[[γ$50$]IorT[F, A, γ$50$], A]
    Definition Classes
    IorTInstances1
  15. implicit def catsDataMonoidForIorT[F[_], A, B](implicit F: Monoid[F[Ior[A, B]]]): Monoid[IorT[F, A, B]]
    Definition Classes
    IorTInstances
  16. implicit def catsDataOrderForIorT[F[_], A, B](implicit F: Order[F[Ior[A, B]]]): Order[IorT[F, A, B]]
    Definition Classes
    IorTInstances1
  17. 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
  18. 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
  19. implicit def catsDataSemigroupForIorT[F[_], A, B](implicit F: Semigroup[F[Ior[A, B]]]): Semigroup[IorT[F, A, B]]
    Definition Classes
    IorTInstances1
  20. implicit def catsDataShowForIorT[F[_], A, B](implicit sh: Show[F[Ior[A, B]]]): Show[IorT[F, A, B]]
    Definition Classes
    IorTInstances
  21. implicit def catsDataTraverseForIorT[F[_], A](implicit F: Traverse[F]): Traverse[[γ$12$]IorT[F, A, γ$12$]]
    Definition Classes
    IorTInstances
  22. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @IntrinsicCandidate()
  23. final def cond[F[_]]: CondPartiallyApplied[F]

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

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

    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)))
  24. 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 on F[B], otherwise, return the value of IorT.left on F[A].

    If the condition is satisfied, return the value of IorT.right on F[B], otherwise, return the value of IorT.left on F[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)
  25. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  27. final def fromEither[F[_]]: FromEitherPartiallyApplied[F]

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

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

    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)))
  28. final def fromEitherF[F[_], E, A](feither: F[Either[E, A]])(implicit F: Functor[F]): IorT[F, E, A]

    Transforms an F[Either] into an IorT.

    Transforms an F[Either] into an IorT.

    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)))
  29. final def fromIor[F[_]]: FromIorPartiallyApplied[F]

    Transforms an Ior into an IorT, lifted into the specified Applicative.

    Transforms an Ior into an IorT, lifted into the specified Applicative.

    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)))
  30. final def fromOption[F[_]]: FromOptionPartiallyApplied[F]

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

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

    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)))
  31. 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 an IorT, using the second argument if the Option is a None.

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

    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)))
  32. 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 monadic F[_] context when the option is None

  33. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  34. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  35. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  36. final def left[B]: LeftPartiallyApplied[B]

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

    Creates a left version of IorT[F, A, B] from a F[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)))
  37. final def leftT[F[_], B]: LeftTPartiallyApplied[F, B]

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

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

    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)))
  38. 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)
  39. 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))
  40. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  41. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  42. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  43. final def pure[F[_], A]: PurePartiallyApplied[F, A]

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

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

    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)))
  44. final def right[A]: RightPartiallyApplied[A]

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

    Creates a right version of IorT[F, A, B] from a F[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)))
  45. 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)))
  46. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  47. def toString(): String
    Definition Classes
    AnyRef → Any
  48. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  50. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from Serializable

Inherited from Serializable

Inherited from IorTInstances

Inherited from IorTInstances1

Inherited from IorTInstances2

Inherited from IorTInstances3

Inherited from AnyRef

Inherited from Any

Ungrouped