The type of the result to unwrap.
The Result, ResultAsync.
The error value, or a Promise of the error value for async results.
The success value if the result is a Success.
import { Result } from '@praha/byethrow';
const result: Result.Result<number, string> = Result.fail('Oops');
const error = Result.unwrapError(result); // 'Oops'
import { Result } from '@praha/byethrow';
const result: Result.Result<number, string> = Result.succeed(100);
const error = Result.unwrapError(result); // throws 100
Extracts the error value from a Result, ResultAsync.
If the result is a Success, it throws the success value (this is rare but symmetric to
unwrap
). For ResultAsync, it returns a Promise that resolves to the error value or rejects with the success value.