Skip to main content
Module

x/fun/fn.ts>map

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 map
import { map } from "https://deno.land/x/fun@v2.0.0-alpha.12/fn.ts";

Map over the output of a Fn. This is equivalent to function composition. ie. a => pipe(f, map(g))(a) === a => g(f(a))

Examples

Example 1

import { map, wrap, pipe } from "./fn.ts";

const result = pipe(wrap(1), map(n => n + 1)); // 2

Parameters

fai: (a: A) => I

Returns

<D>(ta: Fn<D, A>) => Fn<D, I>