A symbolic alias for zipParRight
.
A symbolic alias for zipRight
.
A symbolic alias for zipParLeft
.
A symbolic alias for zipPar
.
A symbolic alias for zipLeft
.
A symbolic alias for zip
.
A symbolic alias for orElseEither
.
A symbolic alias for flatMap
.
Transforms both the A
value and the B
value with the specified
functions f
and g
.
Returns a new computation based on the successful result of this computation.
Returns a new computation based on the successful result of this
computation. If this computation contains a success the new computation
will be performed, even if this computation also contains errors. Any
errors produced by the two computations will be combined using the
Associative
instance for A
. If this computation does not contain a
success then the original failure will be returned unchanged.
Flattens a nested These
computation to a single level.
Flips the left and right values.
Folds each of the possibile cases into a summary value.
Transforms the successful result of this compuation with the specified effectual function, leaving any error value unchanged.
Returns whether this value is a Both
.
Returns whether this value is a Left
.
Returns whether this value is a Right
.
Transforms the B
value with the specified function.
Transforms the A
value with the specified function.
Converts this value to an Either
containing a Right
if this value
contains a success or a Left
otherwise, discarding information about any
errors in the case of success.
Converts this value to an Option
containing Some
if this value
contains a success or None
otherwise, discarding information about any
errors in the case of success.
Converts this value to a validation success if this value contains a success or a validation failure otherwise, discarding information about any errors in the case of success.
Converts this value to a validation success if this value contains a success or a validation failure otherwise, submerging multiple errors into the structure of the validation and discarding information about any errors in the case of success.
Combines this computation sequentially with that computation, combining their results into a tuple.
Combines this computation sequentially with that computation, combining
their results into a tuple. If this computation does not return a success
that computation will not be performed. If both computations are performed
any errors will be combined using the Associative
instance for A
.
Combines this computation sequentially with that computation, returning only the left value.
Combines this computation sequentially with that computation, returning
only the left value. If this computation does not return a success that
computation will not be performed. If both computations are performed any
errors will be combined using the Associative
instance for A
.
Combines this computation with that computation into a tuple, performing
both computations even if this computation does not return a success and
combining any errors using the Commutative
instance for A
.
Combines this computation with that computation and returning only the
left value, performing both computations even if this computation does not
return a success and combining any errors using the Commutative
instance
for A
.
Combines this computation with that computation and returning only the
right value, performing both computations even if this computation does
not return a success and combining any errors using the Commutative
instance for A
.
Combines this computation sequentially with that computation, returning only the right value.
Combines this computation sequentially with that computation, returning
only the right value. If this computation does not return a success that
computation will not be performed. If both computations are performed any
errors will be combined using the Associative
instance for A
.
Combines this computation sequentially with that computation, combining their results with the specified function.
Combines this computation sequentially with that computation, combining
their results with the specified function. If this computation does
not return a success that computation will not be performed. If both
computations are performed any errors will be combined using the
Associative
instance for A
.
Combines this computation with that computation using the specified
function, performing both computations even if this computation does not
return a success and combining any errors using the Commutative
instance for A
.
These
is a data type representing a value that may either be aLeft
with anA
, aRight
with aB
, or aBoth
with anA
and aB
.These
can be useful to model certain domains where both values may be present in addition to one or the other. For example, in streaming applications we may want to consume values from two upstream producers concurrently. Depending on the timing of the producers either one producer, the other, or both producers may have values that are ready to be consumed. UsingThese
provides a convenient way to model all of these possibilities in a single "flat" data type.These
can also be useful for representing computations that may produce both a value and an error. For example, transferring money between two bank accounts might either succeed, fail completely if there are not sufficient funds, or succeed with some warnings if the sender's account balance would be very low after the transfer or the receiver's account has not been verified.These
allows modeling these types of computations and preserving information regarding all errors while still potentially returning a successful computation.