Skip to main content
Module

x/fun/fn_either.ts>idLeft

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function idLeft
import { idLeft } from "https://deno.land/x/fun@v2.0.0/fn_either.ts";

Perform the same function as Reader askLeft. Given a type B (and optionally a type A), return a FnEither<[B], B, A>. This is useful for starting a FnEither flatmap with a left value.

Examples

Example 1

import * as FE from "./fn_either.ts";
import { pipe } from "./fn.ts";

const computation = FE.idLeft<number>();

const result1 = computation(1); // Left(1);
const result2 = computation(2); // Left(2);

Type Parameters

B
optional
A = never