Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

map

import { map } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/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))

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

const result = pipe(wrap(1), map(n => n + 1)); // 2
function map<A, I>(fai: (a: A) => I): <D>(ta: Fn<D, A>) => Fn<D, I>;
§
map<A, I>(fai: (a: A) => I): <D>(ta: Fn<D, A>) => Fn<D, I>
[src]

§Type Parameters

§Parameters

§
fai: (a: A) => I
[src]

§Return Type

§
<D>(ta: Fn<D, A>) => Fn<D, I>
[src]