Skip to main content
Module

x/fun/mod.ts>comparable.fromCompare

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 comparable.fromCompare
import { comparable } from "https://deno.land/x/fun@v2.0.0-alpha.12/mod.ts";
const { fromCompare } = comparable;

Create a Comparable from a Compare function.

Examples

Example 1

import { fromCompare } from "./comparable.ts";
import { pipe } from "./fn.ts";

const { compare } = fromCompare<number>(
  (second) => (first) => first === second
);

const result = compare(1)(1); // true

Parameters

optional
compare: Compare<A> = [UNSUPPORTED]