Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fun/mod.ts>eq.tuple

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

Creates a eq that compares, index for index, tuples according to the order and eqs passed into tuple.

Examples

Example 1

import { tuple, number, string } from "./eq.ts";

const { equals } = tuple(number, string);

const result1 = equals([1, "Hello"])([1, "Goodbye"]); // false
const result2 = equals([1, ""])([1, ""]); // true

Type Parameters

T extends ReadonlyArray<Eq<any>>

Parameters

...Eqs: T

Returns

Eq<[K in keyof T]: T[K] extends Eq<infer A> ? A : never>