Infers the Failure value type E from a Result or a function returning a Result.
E
A ResultMaybeAsync type or a function returning it.
import { Result } from '@praha/byethrow';type R = Result.Result<number, string>;type ErrorValue = Result.InferFailure<R>; // string Copy
import { Result } from '@praha/byethrow';type R = Result.Result<number, string>;type ErrorValue = Result.InferFailure<R>; // string
import { Result } from '@praha/byethrow';const fn = () => Promise.resolve({ type: 'Failure', error: new Error() } as const);type ErrorValue = Result.InferFailure<typeof fn>; // Error Copy
import { Result } from '@praha/byethrow';const fn = () => Promise.resolve({ type: 'Failure', error: new Error() } as const);type ErrorValue = Result.InferFailure<typeof fn>; // Error
Infers the Failure value type
E
from a Result or a function returning a Result.