Skip to main content
Module

x/hkts/option.ts>getSetoid

Functional programming tools: option, either, task, state, optics, etc.
Latest
variable getSetoid
import { getSetoid } from "https://deno.land/x/hkts@v0.0.52/option.ts";

Generates a Setoid module for an option with inner type of A.

Examples

const Setoid = getSetoid({ equals: (a: number, b: number) => a === b }); const a = Setoid.equals(some(1), some(2)); // false const b = Setoid.equals(some(1), some(1)); // true const c = Setoid.equals(none, none); // true const d = Setoid.equals(some(1), none); // false

type

<A>(S: TC.Setoid<A>) => TC.Setoid<Option<A>>