Skip to main content
Module

x/fun/mod.ts>pair.getFirst

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

Extracts the first value from a Pair.

Examples

Example 1

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

const shouldBe1 = pipe(
  P.pair(1, 2),
  P.getFirst
); // 1

Parameters

unnamed 0: Pair<A, B>