Skip to main content
Module

x/fun/pair.ts>first

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

A curried form of the pair constructor, starting with the first value of a pair.

Examples

Example 1

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

const result = pipe(
  37,
  P.first("Brandon"),
  P.mapSecond(n => n + 1),
); // ["Brandon", 38]

Returns

<B>(second: B) => Pair<A, B>