BioEither

izumi.functional.bio.impl.BioEither
See theBioEither companion object
open class BioEither extends Error2[Either]

Attributes

Companion
object
Graph
Supertypes
trait Error2[Either]
trait ErrorAccumulatingOps2[Either]
trait Monad2[Either]
trait ApplicativeError2[Either]
trait Bifunctor2[Either]
trait Guarantee2[Either]
trait Applicative2[Either]
trait Functor2[Either]
trait RootBifunctor[Either]
trait Root
class Object
trait Matchable
class Any
Show all
Known subtypes
object BioEither

Members list

Type members

Inherited types

Attributes

Inherited from:
DivergenceHelper

Attributes

Inherited from:
PredefinedHelper

Value members

Concrete methods

final override def catchAll[E, A, E2](r: Either[E, A])(f: E => Either[E2, A]): Either[E2, A]

Attributes

Definition Classes
override def collectFirst[E, A, B](l: Iterable[A])(f: A => Either[E, Option[B]]): Either[E, Option[B]]

Attributes

Definition Classes
final override def fail[E](v: => E): Either[E, Nothing]

Attributes

Definition Classes
override def find[E, A](l: Iterable[A])(f: A => Either[E, Boolean]): Either[E, Option[A]]

Attributes

Definition Classes
final override def flatMap[E, A, B](r: Either[E, A])(f: A => Either[E, B]): Either[E, B]

Attributes

Definition Classes
override def foldLeft[E, A, AC](col: Iterable[A])(z: AC)(op: (AC, A) => Either[E, AC]): Either[E, AC]

Attributes

Definition Classes
final override def fromAttempt[A](effect: => A): Either[Throwable, A]

For lazy monads: alias for IO2#syncThrowable. For strict monads, shorthand for F.fromTry(Try(effect))

For lazy monads: alias for IO2#syncThrowable. For strict monads, shorthand for F.fromTry(Try(effect))

Attributes

Definition Classes
final override def fromEither[E, V](effect: => Either[E, V]): Either[E, V]

Attributes

Definition Classes
final override def fromOption[E, A](errorOnNone: => E)(effect: => Option[A]): Either[E, A]

Attributes

Definition Classes
final override def fromTry[A](effect: => Try[A]): Either[Throwable, A]

Attributes

Definition Classes
final override def guarantee[E, A](f: Either[E, A], cleanup: Either[Nothing, Unit]): Either[E, A]

Attributes

Definition Classes
final override def map[E, A, B](r: Either[E, A])(f: A => B): Either[E, B]

Attributes

Definition Classes
final override def map2[E, A, B, C](firstOp: Either[E, A], secondOp: => Either[E, B])(f: (A, B) => C): Either[E, C]

execute two operations in order, map their results

execute two operations in order, map their results

Attributes

Definition Classes
override def partition[E, A](l: Iterable[Either[E, A]]): Right[Nothing, (List[E], List[A])]

Attributes

Definition Classes
final override def pure[A](a: A): Either[Nothing, A]

Attributes

Definition Classes
override def traverse[E, A, B](l: Iterable[A])(f: A => Either[E, B]): Either[E, List[B]]

Attributes

Definition Classes

Inherited methods

override def *>[E, A, B](f: Either[E, A], next: => Either[E, B]): Either[E, B]

execute two operations in order, return result of second operation

execute two operations in order, return result of second operation

Attributes

Definition Classes
Inherited from:
Monad2
override def <*[E, A, B](f: Either[E, A], next: => Either[E, B]): Either[E, A]

execute two operations in order, same as *>, but return result of first operation

execute two operations in order, same as *>, but return result of first operation

Attributes

Definition Classes
Inherited from:
Monad2
override def InnerF: Functor2[Either]

Attributes

Definition Classes
Inherited from:
ApplicativeError2
def as[E, A, B](r: Either[E, A])(v: => B): Either[E, B]

Attributes

Inherited from:
Functor2
def attempt[E, A](r: Either[E, A]): Either[Nothing, Either[E, A]]

Attributes

Inherited from:
Error2
override def bimap[E, A, E2, B](r: Either[E, A])(f: E => E2, g: A => B): Either[E2, B]

Attributes

Definition Classes
Inherited from:
Error2
def catchSome[E, A, E1 >: E](r: Either[E, A])(f: PartialFunction[E, Either[E1, A]]): Either[E1, A]

Attributes

Inherited from:
Error2
def collect[E, A, B](l: Iterable[A])(f: A => Either[E, Option[B]]): Either[E, List[B]]

Attributes

Inherited from:
Applicative2
def filter[E, A](l: Iterable[A])(f: A => Either[E, Boolean]): Either[E, List[A]]

Attributes

Inherited from:
Applicative2
def flatSequence[E, A](l: Iterable[Either[E, Iterable[A]]]): Either[E, List[A]]

Attributes

Inherited from:
Applicative2
def flatSequenceAccumErrors[ColR <: (IterableOnce), ColIn <: (IterableOnce), ColL[_], E, A](col: ColR[Either[ColL[E], ColIn[A]]])(implicit buildR: Factory[A, ColR[A]], buildL: Factory[E, ColL[E]], iterL: ColL[E] => IterableOnce[E]): Either[ColL[E], ColR[A]]

flatSequence with error accumulation

flatSequence with error accumulation

Attributes

Inherited from:
ErrorAccumulatingOps2
def flatTraverse[E, A, B](l: Iterable[A])(f: A => Either[E, Iterable[B]]): Either[E, List[B]]

Attributes

Inherited from:
Applicative2
def flatTraverseAccumErrors[ColR <: (IterableOnce), ColIn <: (IterableOnce), ColL[_], E, A, B](col: ColR[A])(f: A => Either[ColL[E], ColIn[B]])(implicit buildR: Factory[B, ColR[B]], buildL: Factory[E, ColL[E]], iterL: ColL[E] => IterableOnce[E]): Either[ColL[E], ColR[B]]

flatTraverse with error accumulation

flatTraverse with error accumulation

Attributes

Inherited from:
ErrorAccumulatingOps2
def flatten[E, A](r: Either[E, Either[E, A]]): Either[E, A]

Attributes

Inherited from:
Monad2
def flip[E, A](r: Either[E, A]): Either[A, E]

Attributes

Inherited from:
Error2
final def forever[E, A](r: Either[E, A]): Either[E, Nothing]

Attributes

Inherited from:
Applicative2
def fromOption[E, A](errorOnNone: => E, r: Either[E, Option[A]]): Either[E, A]

Extracts the optional value or fails with the errorOnNone error

Extracts the optional value or fails with the errorOnNone error

Attributes

Inherited from:
Error2
def fromOptionF[E, A](fallbackOnNone: => Either[E, A], r: Either[E, Option[A]]): Either[E, A]

Extracts the optional value, or executes the fallbackOnNone effect

Extracts the optional value, or executes the fallbackOnNone effect

Attributes

Inherited from:
Monad2
def fromOptionOr[E, A](valueOnNone: => A, r: Either[E, Option[A]]): Either[E, A]

Extracts the optional value, or returns the given valueOnNone value

Extracts the optional value, or returns the given valueOnNone value

Attributes

Inherited from:
Functor2
final def ifThenElse[E, E1, A](cond: Either[E, Boolean])(ifTrue: => Either[E1, A], ifFalse: => Either[E1, A])(implicit ev: E <:< E1): Either[E1, A]

Attributes

Inherited from:
Monad2
final def ifThenElse[E, A](cond: Boolean)(ifTrue: => Either[E, A], ifFalse: => Either[E, A]): Either[E, A]

Attributes

Inherited from:
Applicative2
final def ifThenFail[E](cond: Boolean)(errorIfTrue: => E): Either[E, Unit]

Attributes

Inherited from:
ApplicativeError2
def iterateUntil[E, A](r: Either[E, A])(p: A => Boolean): Either[E, A]

Execute an action repeatedly until its result satisfies the given predicate and return that result, discarding all others.

Execute an action repeatedly until its result satisfies the given predicate and return that result, discarding all others.

Attributes

Inherited from:
Monad2
def iterateUntilF[E, A](init: A)(f: A => Either[E, A])(p: A => Boolean): Either[E, A]

Apply an effectful function iteratively until its result satisfies the given predicate and return that result.

Apply an effectful function iteratively until its result satisfies the given predicate and return that result.

Attributes

Inherited from:
Monad2
def iterateWhile[E, A](r: Either[E, A])(p: A => Boolean): Either[E, A]

Execute an action repeatedly until its result fails to satisfy the given predicate and return that result, discarding all others.

Execute an action repeatedly until its result fails to satisfy the given predicate and return that result, discarding all others.

Attributes

Inherited from:
Monad2
def iterateWhileF[E, A](init: A)(f: A => Either[E, A])(p: A => Boolean): Either[E, A]

Apply an effectful function iteratively until its result fails to satisfy the given predicate and return that result.

Apply an effectful function iteratively until its result fails to satisfy the given predicate and return that result.

Attributes

Inherited from:
Monad2
def leftFlatMap[E, A, E2](r: Either[E, A])(f: E => Either[Nothing, E2]): Either[E2, A]

Attributes

Inherited from:
Error2
def leftMap[E, A, E2](r: Either[E, A])(f: E => E2): Either[E2, A]

Attributes

Inherited from:
Bifunctor2
override def leftMap2[E, A, E2, E3](firstOp: Either[E, A], secondOp: => Either[E2, A])(f: (E, E2) => E3): Either[E3, A]

map errors from two operations into a new error if both fail

map errors from two operations into a new error if both fail

Attributes

Definition Classes
Inherited from:
Error2
override def orElse[E, A, E2](r: Either[E, A], f: => Either[E2, A]): Either[E2, A]

execute second operation only if the first one fails

execute second operation only if the first one fails

Attributes

Definition Classes
Inherited from:
Error2
def redeem[E, A, E2, B](r: Either[E, A])(err: E => Either[E2, B], succ: A => Either[E2, B]): Either[E2, B]

Attributes

Inherited from:
Error2
def redeemPure[E, A, B](r: Either[E, A])(err: E => B, succ: A => B): Either[Nothing, B]

Attributes

Inherited from:
Error2
def retryUntil[E, A](r: Either[E, A])(f: E => Boolean): Either[E, A]

Retries this effect until its error satisfies the specified predicate.

Retries this effect until its error satisfies the specified predicate.

Attributes

Inherited from:
Error2
def retryUntilF[E, A](r: Either[E, A])(f: E => Either[Nothing, Boolean]): Either[E, A]

Retries this effect until its error satisfies the specified effectful predicate.

Retries this effect until its error satisfies the specified effectful predicate.

Attributes

Inherited from:
Error2
def retryWhile[E, A](r: Either[E, A])(f: E => Boolean): Either[E, A]

Retries this effect while its error satisfies the specified predicate.

Retries this effect while its error satisfies the specified predicate.

Attributes

Inherited from:
Error2
def retryWhileF[E, A](r: Either[E, A])(f: E => Either[Nothing, Boolean]): Either[E, A]

Retries this effect while its error satisfies the specified effectful predicate.

Retries this effect while its error satisfies the specified effectful predicate.

Attributes

Inherited from:
Error2
def sequence[E, A](l: Iterable[Either[E, A]]): Either[E, List[A]]

Attributes

Inherited from:
Applicative2
def sequenceAccumErrors[ColR <: (IterableOnce), ColL[_], E, A](col: ColR[Either[ColL[E], A]])(implicit buildR: Factory[A, ColR[A]], buildL: Factory[E, ColL[E]], iterL: ColL[E] => IterableOnce[E]): Either[ColL[E], ColR[A]]

sequence with error accumulation

sequence with error accumulation

Attributes

Inherited from:
ErrorAccumulatingOps2
def sequenceAccumErrorsNEList[ColR <: (IterableOnce), E, A](col: ColR[Either[E, A]])(implicit buildR: Factory[A, ColR[A]]): Either[NEList[E], ColR[A]]

sequence with error accumulation

sequence with error accumulation

Attributes

Inherited from:
ErrorAccumulatingOps2
def sequenceAccumErrors_[ColR <: (IterableOnce), ColL[_], E, A](col: ColR[Either[ColL[E], A]])(implicit buildL: Factory[E, ColL[E]], iterL: ColL[E] => IterableOnce[E]): Either[ColL[E], Unit]

sequence_ with error accumulation

sequence_ with error accumulation

Attributes

Inherited from:
ErrorAccumulatingOps2
def sequence_[E](l: Iterable[Either[E, Unit]]): Either[E, Unit]

Attributes

Inherited from:
Applicative2
def tailRecM[E, A, B](a: A)(f: A => Either[E, Either[A, B]]): Either[E, B]

Attributes

Inherited from:
Monad2
def tap[E, A](r: Either[E, A], f: A => Either[E, Unit]): Either[E, A]

Attributes

Inherited from:
Monad2
def tapBoth[E, A, E1 >: E](r: Either[E, A])(err: E => Either[E1, Unit], succ: A => Either[E1, Unit]): Either[E1, A]

Attributes

Inherited from:
Error2
def tapError[E, A, E1 >: E](r: Either[E, A])(f: E => Either[E1, Unit]): Either[E1, A]

Attributes

Inherited from:
Error2
final def traverse[E, A, B](o: Option[A])(f: A => Either[E, B]): Either[E, Option[B]]

Attributes

Inherited from:
Applicative2
def traverseAccumErrors[ColR <: (IterableOnce), ColL[_], E, A, B](col: ColR[A])(f: A => Either[ColL[E], B])(implicit buildR: Factory[B, ColR[B]], buildL: Factory[E, ColL[E]], iterL: ColL[E] => IterableOnce[E]): Either[ColL[E], ColR[B]]

traverse with error accumulation

traverse with error accumulation

Attributes

Inherited from:
ErrorAccumulatingOps2
def traverseAccumErrorsNEList[ColR <: (IterableOnce), E, A, B](col: ColR[A])(f: A => Either[E, B])(implicit buildR: Factory[B, ColR[B]]): Either[NEList[E], ColR[B]]

traverse with error accumulation

traverse with error accumulation

Attributes

Inherited from:
ErrorAccumulatingOps2
def traverseAccumErrors_[ColR <: (IterableOnce), ColL[_], E, A](col: ColR[A])(f: A => Either[ColL[E], Unit])(implicit buildL: Factory[E, ColL[E]], iterL: ColL[E] => IterableOnce[E]): Either[ColL[E], Unit]

traverse_ with error accumulation

traverse_ with error accumulation

Attributes

Inherited from:
ErrorAccumulatingOps2
def traverse_[E, A](l: Iterable[A])(f: A => Either[E, Unit]): Either[E, Unit]

Attributes

Inherited from:
Applicative2
def unit: Either[Nothing, Unit]

Attributes

Inherited from:
Applicative2
final def unless[E, E1](cond: Either[E, Boolean])(ifFalse: => Either[E1, Unit])(implicit ev: E <:< E1): Either[E1, Unit]

Attributes

Inherited from:
Monad2
final def unless[E](cond: Boolean)(ifFalse: => Either[E, Unit]): Either[E, Unit]

Attributes

Inherited from:
Applicative2
def void[E, A](r: Either[E, A]): Either[E, Unit]

Attributes

Inherited from:
Functor2
final def when[E, E1](cond: Either[E, Boolean])(ifTrue: => Either[E1, Unit])(implicit ev: E <:< E1): Either[E1, Unit]

Attributes

Inherited from:
Monad2
final def when[E](cond: Boolean)(ifTrue: => Either[E, Unit]): Either[E, Unit]

Attributes

Inherited from:
Applicative2
final def widen[E, A, A1](r: Either[E, A])(implicit ev: A <:< A1): Either[E, A1]

Attributes

Inherited from:
Functor2
final def widenBoth[E, A, E1, A1](r: Either[E, A])(implicit ev: E <:< E1, ev2: A <:< A1): Either[E1, A1]

Attributes

Inherited from:
Bifunctor2
final def widenError[E, A, E1](r: Either[E, A])(implicit ev: E <:< E1): Either[E1, A]

Attributes

Inherited from:
Bifunctor2
final def withFilter[E, A](r: Either[E, A])(predicate: A => Boolean)(implicit filter: WithFilter[E], pos: SourceFilePositionMaterializer): Either[E, A]

for-comprehensions sugar:

for-comprehensions sugar:

 for {
   (1, 2) &lt;- F.pure((2, 1))
 } yield ()

Use widenError to for pattern matching with non-Throwable errors:

 val f = for {
   (1, 2) &lt;- F.pure((2, 1)).widenError[Option[Unit]]
 } yield ()
 // f: F[Option[Unit], Unit] = F.fail(Some(())

Attributes

Inherited from:
Error2
def zip[E, A, B](firstOp: Either[E, A], secondOp: => Either[E, B]): Either[E, (A, B)]

Attributes

Inherited from:
Applicative2