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]§Parameters
§
fbui: (b: B) => SyncEither<J, I>
[src]§Return Type
§
<A>(ua: SyncEither<B, A>) => SyncEither<J, A | I>
[src]