import { combinable } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { first } = combinable;
Get an Combinable over A that always returns the first parameter supplied to combine (confusingly this is actually the last parameter since combine is in curried form).
Examples
Example 1
Example 1
import { first, getCombineAll } from "./combinable.ts";
import { pipe } from "./fn.ts";
type Person = { name: string, age: number };
const FirstPerson = first<Person>();
const getFirstPerson = getCombineAll(FirstPerson);
const octavia: Person = { name: "Octavia", age: 42 };
const kimbra: Person = { name: "Kimbra", age: 32 };
const brandon: Person = { name: "Brandon", age: 37 };
const result = getFirstPerson(octavia, kimbra, brandon); // octavia