Skip to main content
Module

x/fun/ord.ts>reverse

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

Derive an Ord with the reverse ordering of an existing Ord.

Examples

Example 1

import { reverse, lt } from "./ord.ts";
import { OrdNumber } from "./number.ts";
import { pipe } from "./fn.ts";

const rev = reverse(OrdNumber);

const result1 = pipe(1, lt(rev)(2)); // false
const result2 = pipe(2, lt(rev)(1)); // true