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

x/fun/mod.ts>sortable.max

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

Construct a maximum 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 max = O.max(SortableNumber);

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

Parameters

unnamed 0: Sortable<A>

Returns

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