import { semigroup } from "https://deno.land/x/fun@v2.0.0-alpha.6/mod.ts";
const { max } = semigroup;
Create a semigroup fron an instance of Ord that returns that maximum for the type being ordered. This Semigroup functions identically to max from Ord.
Examples
Example 1
Example 1
import * as SG from "./semigroup.ts";
import * as N from "./number.ts";
import { pipe } from "./fn.ts";
const { concat } = SG.max(N.OrdNumber);
const biggest = pipe(
0,
concat(-1),
concat(10),
concat(1000),
concat(5),
concat(9001)
); // biggest is over 9000
Parameters
ord: Ord<A>