import { ap } from "https://deno.land/x/fae@v1.1.1/ap.ts";
Iit applies a list of functions to a list of values.
Dispatches to the ap
method of the second argument, if present. Also
treats curried functions as applicatives.
const mul2 = Fae.multiply(2)
const add3 = Fae.add(3)
Fae.ap([mul2, add3], [1, 2, 3]) // [2, 4, 6, 4, 5, 6])
const h = Fae.ap(f, mul2)
h(10) // 10 + (10 * 2))
const obj = {ap: (n: number) => 'called ap with ' + n}
Fae.ap(obj, 10) // 'called ap with 10'