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

Either

import type { Either } from "https://raw.githubusercontent.com/baetheus/fun/main/either.ts";

The Either type is a discriminated union of Left and Right, representing two exclusive possibilities. Either<L, R> can be either Left or Right.

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

type Result = E.Either<string, number>;

const success: Result = E.right(42);
const failure: Result = E.left("Invalid input");
type Either<L, R> = Left<L> | Right<R>;

§Type Parameters

§Type