Skip to main content
Module

x/fun/fn_either.ts>map

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

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>