Skip to main content
Module

x/fun/pair.ts>pair

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

Creates a Pair from two values first and second with types A and B respectively. Used to quickly construct a Pair.

Examples

Example 1

import * as P from "./pair.ts";

const nameAndAge = P.pair("Brandon", 37);

const name = P.getFirst(nameAndAge); // "Brandon"
const age = P.getSecond(nameAndAge); // 37

Parameters

first: A
second: B