Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

alt

import { alt } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/fn_either.ts";

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

@example
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")
function alt<A, B, D>(ub: FnEither<D, B, A>): (ua: FnEither<D, B, A>) => FnEither<D, B, A>;
§
alt<A, B, D>(ub: FnEither<D, B, A>): (ua: FnEither<D, B, A>) => FnEither<D, B, A>
[src]

§Type Parameters

§Parameters

§
ub: FnEither<D, B, A>
[src]

§Return Type

§
(ua: FnEither<D, B, A>) => FnEither<D, B, A>
[src]