Skip to main content
Module

x/fun/fn_either.ts>alt

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function alt
import { alt } from "https://deno.land/x/fun@v2.0.0/fn_either.ts";

Provide an alternative FnEither in the event that an original FnEither returns Left.

Examples

Example 1

import * as FE from "./fn_either.ts";
import { pipe } from "./fn.ts";

const result = pipe(
  FE.left("Oh no I broke!"),
  FE.alt(FE.right("But I work")),
)(null); // Right("But I work")

Returns

(ua: FnEither<D, B, A>) => FnEither<D, B, A>