import { pair } from "https://deno.land/x/fun@v2.0.0-alpha.6/mod.ts";
const { extend } = pair;
Creates a new pair by constructing a first value from the whole pair and keeping the second value from the original pair. Can be used somewhat like a superpowered Reader.
Examples
Example 1
Example 1
import { extend, pair } from "./pair.ts";
import { pipe } from "./fn.ts";
const result = pipe(
pair("Brandon", 37),
extend(([name, age]) => `${name} is ${age}`)
); // ["Brandon is 37", 37];