Skip to main content
Module

x/fun/mod.ts>combinable.max

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

Create a combinable fron an instance of Sortable that returns that maximum for the type being ordered. This Combinable functions identically to max from Sortable.

Examples

Example 1

import * as SG from "./combinable.ts";
import * as N from "./number.ts";
import { pipe } from "./fn.ts";

const { combine } = SG.max(N.SortableNumber);

const biggest = pipe(
  0,
  combine(-1),
  combine(10),
  combine(1000),
  combine(5),
  combine(9001)
); // biggest is over 9000

Parameters

sortable: Sortable<A>