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

fromEither

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

Turn an Either into a FnEither.

@example
import * as FE from "./fn_either.ts";
import * as E from "./either.ts";

const left = E.left(1);
const right = E.right(1);

const fnLeft = FE.fromEither(left);
const fnRight = FE.fromEither(right);

const result1 = fnLeft(null); // Left(1);
const result2 = fnRight(null); // Right(1);
function fromEither<A, B, D = unknown>(ua: Either<B, A>): FnEither<D, B, A>;
§
fromEither<A, B, D = unknown>(ua: Either<B, A>): FnEither<D, B, A>
[src]

§Type Parameters

§
D = unknown
[src]

§Parameters

§
ua: Either<B, A>
[src]

§Return Type