Ior

object Ior extends IorInstances with IorFunctions with IorFunctions2
Companion
class
trait Sum
trait Mirror
trait IorFunctions2
trait IorFunctions
class IorInstances
class IorInstances0
class Object
trait Matchable
class Any

Type members

Classlikes

final case class Both[+A, +B](a: A, b: B) extends Ior[A, B]
final case class Left[+A](a: A) extends Ior[A, Nothing]
final case class Right[+B](b: B) extends Ior[Nothing, B]

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Inherited from
Mirror

Value members

Inherited methods

def both[A, B](a: A, b: B): Ior[A, B]
Inherited from
IorFunctions
def bothNec[A, B](a: A, b: B): IorNec[A, B]
Inherited from
IorFunctions2
def bothNel[A, B](a: A, b: B): IorNel[A, B]
Inherited from
IorFunctions
def fromEither[A, B](eab: Either[A, B]): Ior[A, B]

Create an Ior from an Either.

Create an Ior from an Either.

Value Params
eab

an Either from which the Ior should be created

Returns

Ior.Left if the Either was a Left, or Ior.Right if the Either was a Right Example:

scala> Ior.fromEither(Left(1))
res0: Ior[Int, Nothing] = Left(1)
scala> Ior.fromEither(Right('1'))
res1: Ior[Nothing, Char] = Right(1)
Inherited from
IorFunctions
def fromOptions[A, B](oa: Option[A], ob: Option[B]): Option[Ior[A, B]]

Create an Ior from two Options if at least one of them is defined.

Create an Ior from two Options if at least one of them is defined.

Value Params
oa

an element (optional) for the left side of the Ior

ob

an element (optional) for the right side of the Ior

Returns

None if both oa and ob are None. Otherwise Some wrapping an Ior.Left, Ior.Right, or Ior.Both if oa, ob, or both are defined (respectively). Example:

scala> Ior.fromOptions(Option.empty[String], Option.empty[Int])
res0: Option[Ior[String, Int]] = None
scala> Ior.fromOptions(Option.empty[String], Some(42))
res1: Option[Ior[String, Int]] = Some(Right(42))
scala> Ior.fromOptions(Some("Error"), Option.empty[Int])
res2: Option[Ior[String, Int]] = Some(Left(Error))
scala> Ior.fromOptions(Some("Warning"), Some(42))
res3: Option[Ior[String, Int]] = Some(Both(Warning,42))
Inherited from
IorFunctions
def left[A, B](a: A): Ior[A, B]
Inherited from
IorFunctions
def leftNec[A, B](a: A): IorNec[A, B]
Inherited from
IorFunctions2
def leftNel[A, B](a: A): IorNel[A, B]
Inherited from
IorFunctions
def right[A, B](b: B): Ior[A, B]
Inherited from
IorFunctions

Implicits

Inherited implicits

implicit val catsBitraverseForIor: Bitraverse[[A, B] =>> Ior[A, B]]
Inherited from
IorInstances
implicit def catsDataBifunctorForIor: Bifunctor[[A, B] =>> Ior[A, B]]
Inherited from
IorInstances
implicit def catsDataEqForIor[A, B](`evidence$8`: Eq[A], `evidence$9`: Eq[B]): Eq[Ior[A, B]]
Inherited from
IorInstances0
implicit def catsDataMonadErrorForIor[A](`evidence$7`: Semigroup[A]): MonadError[[_] =>> Ior[A, _$60], A]
Inherited from
IorInstances
implicit def catsDataOrderForIor[A, B](`evidence$1`: Order[A], `evidence$2`: Order[B]): Order[Ior[A, B]]
Inherited from
IorInstances
implicit def catsDataParallelForIor[E](E: Semigroup[E]): Aux[[_] =>> Ior[E, _$62], [_] =>> Ior[E, _$63]]
Inherited from
IorInstances
implicit def catsDataSemigroupForIor[A, B](`evidence$5`: Semigroup[A], `evidence$6`: Semigroup[B]): Semigroup[Ior[A, B]]
Inherited from
IorInstances
implicit def catsDataShowForIor[A, B](`evidence$3`: Show[A], `evidence$4`: Show[B]): Show[Ior[A, B]]
Inherited from
IorInstances
implicit def catsDataTraverseFunctorForIor[A]: Traverse[[_] =>> Ior[A, _$75]]
Inherited from
IorInstances0