Function: Fail()
function Fail<T>(error: unknown): Either<T>
function Fail<T>(error: unknown): Either<T>
function Fail<T>(error: unknown): Either<T>
function Fail<T>(error: unknown): Either<T>
A constructor function that takes an error and returns an Either
object with undefined as the result and the error as the error.
The error will always be an instance of Error.
Type Parameters
Type Parameter | Default type |
---|---|
T | any |
Parameters
Parameter | Type | Description |
---|---|---|
error | unknown |
Returns
Either
<T
>