Returns Success
containing a tuple of this
value and that
value if both
this
and that
are instances of Success
, or Failure
if either is an instance of Failure
.
Returns Success
containing a tuple of this
value and that
value if both
this
and that
are instances of Success
, or Failure
if either is an instance of Failure
.
This is somewhat analogous to a Boolean and operation, because the result is Success
if and only if this
and that
are Success
.
Returns the result of applying a fallible transformation f
to this
object's value if this is an instance of success.
Returns the result of applying a fallible transformation f
to this
object's value if this is an instance of success.
The resulting object will be an instance of Success
if and only if
both this and the transformation result are instances of Success
.
Returns all errors.
Returns all errors.
If this is an instance of Success
, returns an empty list, An instance of
Failure
may also return an empty list, denoting failure without any explanation.
Returns true if this is an instance of Failure
, or false otherwise.
Returns true if this is an instance of Failure
, or false otherwise.
Returns true if this is an instance of Success
, or false otherwise.
Returns true if this is an instance of Success
, or false otherwise.
Returns the result of applying f
to this object's value if this is an instance of Success
.
Returns the result of applying f
to this object's value if this is an instance of Success
.
Returns the result of applying f
to each error.
Returns the result of applying f
to each error.
Returns Right
if this is an instance of Success
, or Left
otherwise.
Returns Right
if this is an instance of Success
, or Left
otherwise.
Returns Some
if this is an instance of Success
, or None
otherwise.
Returns Some
if this is an instance of Success
, or None
otherwise.
Returns the first Success
among this
and that
, or Failure
if both are failures.
Returns the first Success
among this
and that
, or Failure
if both are failures.
This is somewhat analogous to a Boolean or operation, because the result
is Success
if and only if this
or that
is Success
.
If both this
and that
are instances of Failure
, then the result contains
the errors from both Failures
.
This method may be useful if you need to select a single value from a sequence of fallible fallbacks.
Class
Failure[E]
represents a list of errors of typeE
.