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

getLeft

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

Extract the Left value as an Option. Returns Some(error) for Left values and None for Right values.

@example
import * as E from "./either.ts";
import * as O from "./option.ts";

const result1 = E.getLeft(E.left("error"));
// Some("error")

const result2 = E.getLeft(E.right(42));
// None
function getLeft<E, A>(ma: Either<E, A>): O.Option<E>;
§
getLeft<E, A>(ma: Either<E, A>): O.Option<E>
[src]

§Type Parameters

§Parameters

§
ma: Either<E, A>
[src]

§Return Type