Package: effect
Module: Result
Checks whether a Result is a Failure.
When to use
Use to narrow a known Result to the Failure variant.
Details
Failure<A, E>.failure to read the error valueExample (Narrowing to failure)
import { Result } from "effect"
const result = Result.fail("oops")
if (Result.isFailure(result)) {
console.log(result.failure)
// Output: "oops"
}
See
isSuccess for the opposite checkisResult to check if a value is any ResultSignature
declare const isFailure: <A, E>(self: Result<A, E>) => self is Failure<A, E>
Since v4.0.0