Skip to main content
Module

x/fun/mod.ts>pair.second

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

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

Examples

Example 1

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

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

Parameters

second: B

Returns

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