Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

tuple

import { tuple } from "https://raw.githubusercontent.com/baetheus/fun/main/combinable.ts";

Get a Combinable from a tuple of combinables. The resulting combinable will operate over tuples applying the input combinables applying each based on its position,

@example
import * as SG from "./combinable.ts";
import { pipe } from "./fn.ts";

type Person = { name: string, age: number };

const first = SG.first<Person>();
const last = SG.last<Person>();
const { combine } = SG.tuple(first, last);

const octavia: Person = { name: "Octavia", age: 42 };
const kimbra: Person = { name: "Kimbra", age: 32 };
const brandon: Person = { name: "Brandon", age: 37 };

const tuplePeople = pipe(
  [octavia, octavia],
  combine([kimbra, kimbra]),
  combine([brandon, brandon]),
); // tuplePeople === [octavia, brandon]
function tuple<T extends AnyCombinable[]>(...combinables: T): Combinable<readonly [K in keyof T]: TypeOf<T[K]>>;
§
tuple<T extends AnyCombinable[]>(...combinables: T): Combinable<readonly [K in keyof T]: TypeOf<T[K]>>
[src]

§Type Parameters

§Parameters

§
...combinables: T optional
[src]

§Return Type

§
Combinable<readonly [K in keyof T]: TypeOf<T[K]>>
[src]