Skip to main content
Module

x/fun/mod.ts>fn_either.id

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

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

Examples

Example 1

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

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

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

Type Parameters

A
optional
B = never