Skip to main content
Module

x/fun/sortable.ts>min

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

Construct a minimum function over A from Sortable.

Examples

Example 1

import * as O from "./sortable.ts";
import { SortableNumber } from "./number.ts";
import { pipe } from "./fn.ts";

const min = O.min(SortableNumber);

const result1 = pipe(1, min(2)); // 1
const result2 = pipe(2, min(1)); // 1
const result3 = pipe(1, min(1)); // 1

Parameters

unnamed 0: Sortable<A>

Returns

(snd: A) => (fst: A) => A