import { fn_either } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { apply } = fn_either;
Given a FnEither returning a function A => I and a FnEither returning a value A, combine them into a FnEither returning an I.
Examples
Example 1
Example 1
import * as FE from "./fn_either.ts";
import { pipe } from "./fn.ts";
type Person = { name: string; age: number };
const person = (name: string) => (age: number): Person => ({ name, age });
const result = pipe(
FE.wrap(person),
FE.apply(FE.wrap("Brandon")),
FE.apply(FE.wrap(37)),
); // FnEither<[], never, Person>