Represents a computation of type F[A \/ B]
.
Example:
val x: Option[String \/ Int] = Some(\/-(1))
EitherT(x).map(1+).run // Some(\/-(2))
- Companion
- object
Type members
Classlikes
Value members
Concrete methods
Sums up values inside disjunction, if both are left or right. Returns first left otherwise.
Sums up values inside disjunction, if both are left or right. Returns first left otherwise.
\/-(v1) +++ \/-(v2) → \/-(v1 + v2)
\/-(v1) +++ -\/(v2) → -\/(v2)
-\/(v1) +++ \/-(v2) → -\/(v1)
-\/(v1) +++ -\/(v2) → -\/(v1 + v2)
Apply a function in the environment of the right of this
disjunction. Because it runs my F
even when f
's \/
fails,
it is not consistent with ap
.
Apply a function in the environment of the right of this
disjunction. Because it runs my F
even when f
's \/
fails,
it is not consistent with ap
.
Binary functor traverse on this disjunction.
Binary functor traverse on this disjunction.
Ensures that the right value of this disjunction satisfies the given predicate, or returns left with the given value.
Ensures that the right value of this disjunction satisfies the given predicate, or returns left with the given value.
Return true
if this disjunction is a right value satisfying the given predicate.
Return true
if this disjunction is a right value satisfying the given predicate.
Bind the inner monad through the right of this disjunction.
Bind the inner monad through the right of this disjunction.
Return true
if this disjunction is a left value or the right value satisfies the given predicate.
Return true
if this disjunction is a left value or the right value satisfies the given predicate.
Return the right value of this disjunction or the given default if left. Alias for |
Return the right value of this disjunction or the given default if left. Alias for |
Return the value from whichever side of the disjunction is defined, given a commonly assignable type.
Return the value from whichever side of the disjunction is defined, given a commonly assignable type.
Return this if it is a right, otherwise, return the given value. Alias for |||
Return this if it is a right, otherwise, return the given value. Alias for |||
Flip the left/right values in this disjunction. Alias for swap
Flip the left/right values in this disjunction. Alias for swap
Run the given function on this swapped value. Alias for ~
Run the given function on this swapped value. Alias for ~
Return an empty list or list with one element on the right of this disjunction.
Return an empty list or list with one element on the right of this disjunction.
Return an empty option or option with one element on the right of this disjunction. Useful to sweep errors under the carpet.
Return an empty option or option with one element on the right of this disjunction. Useful to sweep errors under the carpet.
Return an empty option or option with one element on the right of this disjunction. Useful to sweep errors under the carpet.
Return an empty option or option with one element on the right of this disjunction. Useful to sweep errors under the carpet.
Return an empty stream or stream with one element on the right of this disjunction.
Return an empty stream or stream with one element on the right of this disjunction.
Return a this
on the left-side or a that
on the right-side of this disjunction
Return a this
on the left-side or a that
on the right-side of this disjunction
Traverse on the right of this disjunction.
Traverse on the right of this disjunction.
Flip the left/right values in this disjunction. Alias for unary_~
Flip the left/right values in this disjunction. Alias for unary_~
Run a validation function and back to disjunction again.
Run a validation function and back to disjunction again.
Return the right value of this disjunction or run the given function on the left.
Return the right value of this disjunction or run the given function on the left.
Return the right value of this disjunction or the given default if left. Alias for getOrElse
Return the right value of this disjunction or the given default if left. Alias for getOrElse
Deprecated methods
If this disjunction is right, return the given X value, otherwise, return the X value given to the return value.
If this disjunction is right, return the given X value, otherwise, return the X value given to the return value.
- Deprecated
[Since version 7.3.0]