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

recover

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

Recover from a Left value by applying a function to it.

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

const result = pipe(
  left("error"),
  recover(e => right(`Recovered from: ${e}`))
);

const value = result(); // Right("Recovered from: error")
function recover<B, J, I>(fbui: (b: B) => SyncEither<J, I>): <A>(ua: SyncEither<B, A>) => SyncEither<J, A | I>;
§
recover<B, J, I>(fbui: (b: B) => SyncEither<J, I>): <A>(ua: SyncEither<B, A>) => SyncEither<J, A | I>
[src]

§Type Parameters

§Parameters

§
fbui: (b: B) => SyncEither<J, I>
[src]

§Return Type

§
<A>(ua: SyncEither<B, A>) => SyncEither<J, A | I>
[src]