Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fun/mod.ts>fn_either.map

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

Map over the right return value of a FnEither.

Examples

Example 1

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

const result = pipe(
  FE.id<number>(),
  FE.map(n => n + 1),
)(0); // Right(1)

Parameters

fai: (a: A) => I

Returns

<B = never, D = unknown>(ua: FnEither<D, B, A>) => FnEither<D, B, I>