fail
Returns an EitherLeft<"fail", never>: perfect to signal a failure without carrying extra data.
TIP
fail is the payload-less alias of left("fail"). For details on customizing the info or adding a value, read the left page.
Interactive example
Syntax
typescript
function fail(): EitherFailParameters
None: the call solely represents the fact that an operation did not succeed.
Return value
A Left tagged "fail" whose wrapped value is never. Combine it with E.whenHasInformation(result, "fail", handler) to run specific logic when no data is available.
Use cases
- A command that fails but has no useful detail to pass along.
- A safeguard ensuring a branch always returns a
Lefteven without context. - Simplify tests by checking only the
"fail"info.
