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>;
§
§Parameters
§
tb: SyncEither<B, A>
[src]§Return Type
§
(ta: SyncEither<B, A>) => SyncEither<B, A>
[src]