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/sync_either.ts";

Provide an alternative SyncEither if the current one fails.

@example
import { alt, left, right } from "./sync_either.ts";
import { pipe } from "./fn.ts";

const result = pipe(
  left("error"),
  alt(right("fallback"))
);

const value = result(); // Right("fallback")
function alt<A = never, B = never>(tb: SyncEither<B, A>): (ta: SyncEither<B, A>) => SyncEither<B, A>;
§
alt<A = never, B = never>(tb: SyncEither<B, A>): (ta: SyncEither<B, A>) => SyncEither<B, A>
[src]

§Type Parameters

§
A = never
[src]
§
B = never
[src]

§Parameters

§Return Type

§
(ta: SyncEither<B, A>) => SyncEither<B, A>
[src]