import { apply } from "https://deno.land/x/fun@v2.0.0/fn.ts";
Given L => A => I and D => A create a new Fn D & L => I. In order to preserve type widening for ap, it only handles unary functions.
Examples
Example 1
Example 1
import * as F from "./fn.ts";
type Person = { name: string, age: number };
const person = (name: string) => (age: number): Person => ({ name, age });
const result = F.pipe(
F.wrap(person),
F.apply(F.wrap("Brandon")),
F.apply(F.wrap(37)),
); // Fn<[], Person>