Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/fun/comparable.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.12/comparable.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 "./comparable.ts";

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

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

Type Parameters

T extends ReadonlyArray<Comparable<any>>

Parameters

...comparables: T

Returns

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