These is a data type representing a value that may either be a Left with anA, a Right with a B, or a Both with an A and a B.
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. Using These 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.
Attributes
- Companion
- object
- Graph
-
- Supertypes
- Known subtypes
- Self type
-
Members list
Value members
Concrete methods
A symbolic alias for zipParRight.
A symbolic alias for zipParRight.
Attributes
A symbolic alias for zipRight.
A symbolic alias for zipRight.
Attributes
A symbolic alias for zipParLeft.
A symbolic alias for zipParLeft.
Attributes
A symbolic alias for zipPar.
A symbolic alias for zipPar.
Attributes
A symbolic alias for zipLeft.
A symbolic alias for zipLeft.
Attributes
A symbolic alias for zip.
A symbolic alias for zip.
Attributes
A symbolic alias for orElseEither.
A symbolic alias for orElseEither.
Attributes
A symbolic alias for flatMap.
A symbolic alias for flatMap.
Attributes
Transforms both the A value and the B value with the specified functions f and g.
Transforms both the A value and the B value with the specified functions f and g.
Attributes
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.
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.
Attributes
Flattens a nested These computation to a single level.
Flattens a nested These computation to a single level.
Attributes
Flips the left and right values.
Flips the left and right values.
Attributes
Folds each of the possible cases into a summary value.
Folds each of the possible cases into a summary value.
Attributes
Transforms the successful result of this computation with the specified effectual function, leaving any error value unchanged.
Transforms the successful result of this computation with the specified effectual function, leaving any error value unchanged.
Attributes
Returns whether this value is a Both.
Returns whether this value is a Both.
Attributes
Returns whether this value is a Left.
Returns whether this value is a Left.
Attributes
Returns whether this value is a Right.
Returns whether this value is a Right.
Attributes
Transforms the B value with the specified function.
Transforms the B value with the specified function.
Attributes
Transforms the A value with the specified function.
Transforms the A value with the specified function.
Attributes
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 Either containing a Right if this value contains a success or a Left otherwise, discarding information about any errors in the case of success.
Attributes
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 an Option containing Some if this value contains a success or None otherwise, discarding information about any errors in the case of success.
Attributes
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, discarding information about any errors in the case of success.
Attributes
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.
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.
Attributes
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, 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.
Attributes
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 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.
Attributes
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 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.
Attributes
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 left value, performing both computations even if this computation does not return a success and combining any errors using the Commutative instance for A.
Attributes
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 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.
Attributes
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, 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.
Attributes
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 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.
Attributes
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.
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.