Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/fun/mod.ts>pair.mapLeft

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 pair.mapLeft
import { pair } from "https://deno.land/x/fun@v2.0.0-alpha.6/mod.ts";
const { mapLeft } = pair;

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

Examples

Example 1

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

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

Parameters

fbj: (a: B) => J

Returns

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