Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

getComparableOption

import { getComparableOption } from "https://raw.githubusercontent.com/baetheus/fun/main/option.ts";

Create an instance of Comparable<Option> given an instance of Comparable.

@example
import * as O from "./option.ts";
import * as N from "./number.ts";
import { pipe } from "./fn.ts";

const { compare } = O.getComparableOption(N.ComparableNumber);

const result1 = pipe(O.some(1), compare(O.some(2))); // false
const result2 = pipe(O.some(1), compare(O.some(1))); // true
const result3 = pipe(O.none, compare(O.none)); // true
const result4 = pipe(O.some(1), compare(O.none)); // false
function getComparableOption<A>({ compare }: Comparable<A>): Comparable<Option<A>>;
§
getComparableOption<A>({ compare }: Comparable<A>): Comparable<Option<A>>
[src]

§Type Parameters

§Parameters

§
{ compare }: Comparable<A>
[src]