Skip to main content
Module

x/fun/mod.ts>pair.map

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

Creates a new Pair with the same second value and a new first value determined by the output of the fai function.

Examples

Example 1

import * as P from "./pair.ts";
import { pipe } from "./fn.ts";

const result = pipe(
  P.pair(1, 2),
  P.map(String),
); // ['1', 2]

Parameters

fai: (a: A) => I

Returns

<B>(ta: Pair<A, B>) => Pair<I, B>