bindFailure<T extends Object> abstract method

  1. @useResult
Result<S, T> bindFailure<T extends Object>(
  1. Result<S, T> function(
    1. F failure
    )
)

If this is a Failure, maps F to Result, otherwise returns S untouched.

See pipeFailure for an asynchronous variant of this function.

Success(1).bindFailure((v) => Failure(v.toString())); // Success(1)

Failure(2).bindFailure((v) => Success(v.toString())); // Success('2')

Implementation

@useResult Result<S, T> bindFailure<T extends Object>(Result<S, T> Function(F failure) function);