Skip to main content
Module

x/fun/mod.ts>eq.literal

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 eq.literal
import { eq } from "https://deno.land/x/fun@v.2.0.0-alpha.11/mod.ts";
const { literal } = eq;

Creates a Eq that compares a union of literals using strict equality.

Examples

Example 1

import { literal } from "./eq.ts";

const { equals } = literal(1, 2, "Three");

const result1 = equals(1)("Three"); // false
const result2 = equals("Three")("Three"); // true

Type Parameters

A extends NonEmptyArray<Literal>

Returns

Eq<A[number]>