Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fun/pair.ts>getFirst

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

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>