import { combinable } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { tuple } = combinable;
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,
Examples
Example 1
Example 1
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]
Type Parameters
T extends AnyCombinable[]
Parameters
...combinables: T
Returns
Combinable<readonly [K in keyof T]: TypeOf<T[K]>>