Class

cats.data.Xor

Left

Related Doc: package Xor

Permalink

final case class Left[+A](a: A) extends Xor[A, Nothing] with Product with Serializable

Linear Supertypes
Xor[A, Nothing], Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Left
  2. Xor
  3. Serializable
  4. Serializable
  5. Product
  6. Equals
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Left(a: A)

    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 ===[AA >: A, BB >: Nothing](that: Xor[AA, BB])(implicit AA: Eq[AA], BB: Eq[BB]): Boolean

    Permalink
    Definition Classes
    Xor
  5. val a: A

    Permalink
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def bimap[C, D](fa: (A) ⇒ C, fb: (Nothing) ⇒ D): Xor[C, D]

    Permalink
    Definition Classes
    Xor
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def combine[AA >: A, BB >: Nothing](that: Xor[AA, BB])(implicit BB: Semigroup[BB]): Xor[AA, BB]

    Permalink

    Combine with another Xor value.

    Combine with another Xor value.

    If this Xor is a Left then it will be returned as-is. If this Xor is a Right and that Xor is a left, then that will be returned. If both Xors are Rights, then the Semigroup[BB] instance will be used to combine both values and return them as a Right. Note: If both Xors are Lefts then their values are not combined. Use Validated if you prefer to combine Left values.

    Examples:

    scala> import cats.data.Xor
    scala> import cats.implicits._
    scala> val l1: Xor[String, Int] = Xor.left("error 1")
    scala> val l2: Xor[String, Int] = Xor.left("error 2")
    scala> val r3: Xor[String, Int] = Xor.right(3)
    scala> val r4: Xor[String, Int] = Xor.right(4)
    
    scala> l1 combine l2
    res0: Xor[String, Int] = Left(error 1)
    
    scala> l1 combine r3
    res1: Xor[String, Int] = Left(error 1)
    
    scala> r3 combine l1
    res2: Xor[String, Int] = Left(error 1)
    
    scala> r3 combine r4
    res3: Xor[String, Int] = Right(7)
    Definition Classes
    Xor
  10. def compare[AA >: A, BB >: Nothing](that: Xor[AA, BB])(implicit AA: Order[AA], BB: Order[BB]): Int

    Permalink
    Definition Classes
    Xor
  11. def ensure[AA >: A](onFailure: ⇒ AA)(f: (Nothing) ⇒ Boolean): Xor[AA, Nothing]

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

    Permalink
    Definition Classes
    AnyRef
  13. def exists(f: (Nothing) ⇒ Boolean): Boolean

    Permalink
    Definition Classes
    Xor
  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: (Nothing) ⇒ Xor[AA, D]): Xor[AA, D]

    Permalink
    Definition Classes
    Xor
  16. def fold[C](fa: (A) ⇒ C, fb: (Nothing) ⇒ C): C

    Permalink
    Definition Classes
    Xor
  17. def foldLeft[C](c: C)(f: (C, Nothing) ⇒ C): C

    Permalink
    Definition Classes
    Xor
  18. def foldRight[C](lc: Eval[C])(f: (Nothing, Eval[C]) ⇒ Eval[C]): Eval[C]

    Permalink
    Definition Classes
    Xor
  19. def forall(f: (Nothing) ⇒ Boolean): Boolean

    Permalink
    Definition Classes
    Xor
  20. def foreach(f: (Nothing) ⇒ Unit): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  22. def getOrElse[BB >: Nothing](default: ⇒ BB): BB

    Permalink
    Definition Classes
    Xor
  23. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  24. def isLeft: Boolean

    Permalink
    Definition Classes
    Xor
  25. def isRight: Boolean

    Permalink
    Definition Classes
    Xor
  26. def leftMap[C](f: (A) ⇒ C): Xor[C, Nothing]

    Permalink
    Definition Classes
    Xor
  27. def map[D](f: (Nothing) ⇒ D): Xor[A, D]

    Permalink
    Definition Classes
    Xor
  28. def map2Eval[AA >: A, C, Z](fc: Eval[Xor[AA, C]])(f: (Nothing, C) ⇒ Z): Eval[Xor[AA, Z]]

    Permalink
    Definition Classes
    Xor
  29. def merge[AA >: A](implicit ev: <:<[Nothing, AA]): AA

    Permalink
    Definition Classes
    Xor
  30. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  33. def orElse[C, BB >: Nothing](fallback: ⇒ Xor[C, BB]): Xor[C, BB]

    Permalink
    Definition Classes
    Xor
  34. def partialCompare[AA >: A, BB >: Nothing](that: Xor[AA, BB])(implicit AA: PartialOrder[AA], BB: PartialOrder[BB]): Double

    Permalink
    Definition Classes
    Xor
  35. def recover[BB >: Nothing](pf: PartialFunction[A, BB]): Xor[A, BB]

    Permalink
    Definition Classes
    Xor
  36. def recoverWith[AA >: A, BB >: Nothing](pf: PartialFunction[A, Xor[AA, BB]]): Xor[AA, BB]

    Permalink
    Definition Classes
    Xor
  37. def show[AA >: A, BB >: Nothing](implicit AA: Show[AA], BB: Show[BB]): String

    Permalink
    Definition Classes
    Xor
  38. def swap: Xor[Nothing, A]

    Permalink
    Definition Classes
    Xor
  39. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  40. def to[F[_], BB >: Nothing](implicit monoidKF: MonoidK[F], applicativeF: Applicative[F]): F[BB]

    Permalink
    Definition Classes
    Xor
  41. def toEither: Either[A, Nothing]

    Permalink
    Definition Classes
    Xor
  42. def toIor: Ior[A, Nothing]

    Permalink
    Definition Classes
    Xor
  43. def toList: List[Nothing]

    Permalink
    Definition Classes
    Xor
  44. def toOption: Option[Nothing]

    Permalink
    Definition Classes
    Xor
  45. def toValidated: Validated[A, Nothing]

    Permalink
    Definition Classes
    Xor
  46. def toValidatedNel[AA >: A]: ValidatedNel[AA, Nothing]

    Permalink

    Returns a ValidatedNel representation of this disjunction with the Left value as a single element on the Invalid side of the NonEmptyList.

    Returns a ValidatedNel representation of this disjunction with the Left value as a single element on the Invalid side of the NonEmptyList.

    Definition Classes
    Xor
  47. def traverse[F[_], AA >: A, D](f: (Nothing) ⇒ F[D])(implicit F: Applicative[F]): F[Xor[AA, D]]

    Permalink
    Definition Classes
    Xor
  48. def valueOr[BB >: Nothing](f: (A) ⇒ BB): BB

    Permalink
    Definition Classes
    Xor
  49. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  52. def withValidated[AA, BB](f: (Validated[A, Nothing]) ⇒ Validated[AA, BB]): Xor[AA, BB]

    Permalink
    Definition Classes
    Xor

Inherited from Xor[A, Nothing]

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped