Class/Object

cats.data

XorT

Related Docs: object XorT | package data

Permalink

case class XorT[F[_], A, B](value: F[Xor[A, B]]) extends Product with Serializable

Transformer for Xor, allowing the effect of an arbitrary type constructor F to be combined with the fail-fast effect of Xor.

XorT[F, A, B] wraps a value of type F[A Xor B]. An F[C] can be lifted in to XorT[F, A, C] via XorT.right, and lifted in to a XorT[F, C, B] via XorT.left.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. XorT
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new XorT(value: F[Xor[A, B]])

    Permalink

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. def ===(that: XorT[F, A, B])(implicit eq: Eq[F[Xor[A, B]]]): Boolean

    Permalink
  5. def applyAlt[D](ff: XorT[F, A, (B) ⇒ D])(implicit F: Apply[F]): XorT[F, A, D]

    Permalink
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def bimap[C, D](fa: (A) ⇒ C, fb: (B) ⇒ D)(implicit F: Functor[F]): XorT[F, C, D]

    Permalink
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def collectRight(implicit F: MonadCombine[F]): F[B]

    Permalink
  10. def combine(that: XorT[F, A, B])(implicit F: Apply[F], A: Semigroup[A], B: Semigroup[B]): XorT[F, A, B]

    Permalink
  11. def compare(that: XorT[F, A, B])(implicit o: Order[F[Xor[A, B]]]): Int

    Permalink
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def exists(f: (B) ⇒ Boolean)(implicit F: Functor[F]): F[Boolean]

    Permalink
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def flatMap[AA >: A, D](f: (B) ⇒ XorT[F, AA, D])(implicit F: Monad[F]): XorT[F, AA, D]

    Permalink
  16. def flatMapF[AA >: A, D](f: (B) ⇒ F[Xor[AA, D]])(implicit F: Monad[F]): XorT[F, AA, D]

    Permalink
  17. def fold[C](fa: (A) ⇒ C, fb: (B) ⇒ C)(implicit F: Functor[F]): F[C]

    Permalink
  18. def foldLeft[C](c: C)(f: (C, B) ⇒ C)(implicit F: Foldable[F]): C

    Permalink
  19. def foldRight[C](lc: Eval[C])(f: (B, Eval[C]) ⇒ Eval[C])(implicit F: Foldable[F]): Eval[C]

    Permalink
  20. def forall(f: (B) ⇒ Boolean)(implicit F: Functor[F]): F[Boolean]

    Permalink
  21. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  22. def getOrElse[BB >: B](default: ⇒ BB)(implicit F: Functor[F]): F[BB]

    Permalink
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. def isLeft(implicit F: Functor[F]): F[Boolean]

    Permalink
  25. def isRight(implicit F: Functor[F]): F[Boolean]

    Permalink
  26. def leftMap[C](f: (A) ⇒ C)(implicit F: Functor[F]): XorT[F, C, B]

    Permalink
  27. def map[D](f: (B) ⇒ D)(implicit F: Functor[F]): XorT[F, A, D]

    Permalink
  28. def merge[AA >: A](implicit ev: <:<[B, AA], F: Functor[F]): F[AA]

    Permalink
  29. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  32. def partialCompare(that: XorT[F, A, B])(implicit p: PartialOrder[F[Xor[A, B]]]): Double

    Permalink
  33. def recover(pf: PartialFunction[A, B])(implicit F: Functor[F]): XorT[F, A, B]

    Permalink
  34. def recoverWith(pf: PartialFunction[A, XorT[F, A, B]])(implicit F: Monad[F]): XorT[F, A, B]

    Permalink
  35. def show(implicit show: Show[F[Xor[A, B]]]): String

    Permalink
  36. def swap(implicit F: Functor[F]): XorT[F, B, A]

    Permalink
  37. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  38. def to[G[_]](implicit functorF: Functor[F], monoidKG: MonoidK[G], applicativeG: Applicative[G]): F[G[B]]

    Permalink
  39. def toEither(implicit F: Functor[F]): F[Either[A, B]]

    Permalink
  40. def toOption(implicit F: Functor[F]): OptionT[F, B]

    Permalink
  41. def toValidated(implicit F: Functor[F]): F[Validated[A, B]]

    Permalink
  42. def traverse[G[_], D](f: (B) ⇒ G[D])(implicit traverseF: Traverse[F], traverseXorA: Traverse[[β]Xor[A, β]], applicativeG: Applicative[G]): G[XorT[F, A, D]]

    Permalink
  43. val value: F[Xor[A, B]]

    Permalink
  44. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. def withValidated[AA, BB](f: (Validated[A, B]) ⇒ Validated[AA, BB])(implicit F: Functor[F]): XorT[F, AA, BB]

    Permalink

    Run this value as a Validated against the function and convert it back to an XorT.

    Run this value as a Validated against the function and convert it back to an XorT.

    The Applicative instance for XorT "fails fast" - it is often useful to "momentarily" have it accumulate errors instead, which is what the Validated data type gives us.

    Example:

    val v1: Validated[NonEmptyList[Error], Int] = ...
    val v2: Validated[NonEmptyList[Error], Int] = ...
    val xort: XorT[Error, Int] = ...
    
    val result: XorT[NonEmptyList[Error], Int] =
      xort.withValidated { v3 => (v1 |@| v2 |@| v3.leftMap(NonEmptyList(_))) { case (i, j, k) => i + j + k } }

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped