const failureResult = failure('some failure').or(reason => failure(reason + ', another failure'));failureResult.orNull(); // produces: nullfailureResult.orElse('Not this'); // produces: "Not this" (orElse returns the fallback for a failure)failureResult.either(value => value, reason => reason); // produces: "some failure, another failure" Copy
const failureResult = failure('some failure').or(reason => failure(reason + ', another failure'));failureResult.orNull(); // produces: nullfailureResult.orElse('Not this'); // produces: "Not this" (orElse returns the fallback for a failure)failureResult.either(value => value, reason => reason); // produces: "some failure, another failure"