sealed abstract class Ior[+A, +B] extends Product with Serializable
Represents a right-biased disjunction that is either an A
, or a B
, or both an A
and a B
.
An instance of A Ior B
is one of:
A Ior B
is similar to scala.util.Either[A, B]
, except that it can represent the simultaneous presence of
an A
and a B
. It is right-biased so methods such as map
and flatMap
operate on the
B
value. Some methods, like flatMap
, handle the presence of two Both values using a
Semigroup[A]
, while other methods, like toEither, ignore the A
value in a Both.
A Ior B
is isomorphic to Either[Either[A, B], (A, B)]
, but provides methods biased toward B
values, regardless of whether the B
values appear in a Right or a Both.
The isomorphic scala.util.Either
form can be accessed via the unwrap method.
- Alphabetic
- By Inheritance
- Ior
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
Concrete 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 ===[AA >: A, BB >: B](that: Ior[AA, BB])(implicit AA: Eq[AA], BB: Eq[BB]): Boolean
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- final def bimap[C, D](fa: (A) ⇒ C, fb: (B) ⇒ D): Ior[C, D]
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- final def combine[AA >: A, BB >: B](that: Ior[AA, BB])(implicit AA: Semigroup[AA], BB: Semigroup[BB]): Ior[AA, BB]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def exists(p: (B) ⇒ Boolean): Boolean
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- final def flatMap[AA >: A, D](f: (B) ⇒ Ior[AA, D])(implicit AA: Semigroup[AA]): Ior[AA, D]
- final def fold[C](fa: (A) ⇒ C, fb: (B) ⇒ C, fab: (A, B) ⇒ C): C
- final def foldLeft[C](c: C)(f: (C, B) ⇒ C): C
- final def foldRight[C](lc: Eval[C])(f: (B, Eval[C]) ⇒ Eval[C]): Eval[C]
- final def forall(p: (B) ⇒ Boolean): Boolean
- final def foreach(f: (B) ⇒ Unit): Unit
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def getOrElse[BB >: B](bb: ⇒ BB): BB
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isBoth: Boolean
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def isLeft: Boolean
- final def isRight: Boolean
- final def left: Option[A]
- final def leftMap[C](f: (A) ⇒ C): Ior[C, B]
- final def map[D](f: (B) ⇒ D): Ior[A, D]
- final def merge[AA >: A](implicit ev: <:<[B, AA], AA: Semigroup[AA]): AA
- final def mergeLeft[AA >: A](implicit ev: <:<[B, AA]): AA
- final def mergeRight[AA >: A](implicit ev: <:<[B, AA]): AA
-
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 onlyBoth: Option[(A, B)]
- final def onlyLeft: Option[A]
- final def onlyLeftOrRight: Option[Either[A, B]]
- final def onlyRight: Option[B]
- final def pad: (Option[A], Option[B])
-
def
productIterator: Iterator[Any]
- Definition Classes
- Product
-
def
productPrefix: String
- Definition Classes
- Product
- final def putLeft[C](left: C): Ior[C, B]
- final def putRight[C](right: C): Ior[A, C]
- final def right: Option[B]
- final def show[AA >: A, BB >: B](implicit AA: Show[AA], BB: Show[BB]): String
- final def swap: Ior[B, A]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
- final def to[F[_], BB >: B](implicit F: Alternative[F]): F[BB]
- final def toEither: Either[A, B]
- final def toIorNec[AA >: A]: IorNec[AA, B]
- final def toIorNel[AA >: A]: IorNel[AA, B]
- final def toIorNes[AA >: A](implicit O: Order[AA]): IorNes[AA, B]
- final def toList: List[B]
- final def toOption: Option[B]
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- final def toValidated: Validated[A, B]
- final def traverse[F[_], AA >: A, D](g: (B) ⇒ F[D])(implicit F: Applicative[F]): F[Ior[AA, D]]
- final def unwrap: Either[Either[A, B], (A, B)]
- final def valueOr[BB >: B](f: (A) ⇒ BB)(implicit BB: Semigroup[BB]): BB
-
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( ... )