Skip to main content
Module

x/fun/eq.ts>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 tuple
import { tuple } from "https://deno.land/x/fun@v2.0.0-alpha.10/eq.ts";

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>