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

getRight

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

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

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

const result1 = E.getRight(E.right(42));
// Some(42)

const result2 = E.getRight(E.left("error"));
// None
function getRight<E, A>(ma: Either<E, A>): O.Option<A>;
§
getRight<E, A>(ma: Either<E, A>): O.Option<A>
[src]

§Type Parameters

§Parameters

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

§Return Type