Skip to main content
Deno 2 is finally here 🎉️
Learn more
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.
Latest
function comparable.fromCompare
import { comparable } from "https://deno.land/x/fun@v2.0.0/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]