Loading search index…
No recent searches
No results for "Query here"
Composes a unary function with a binary function. Useful for composing functions where the second function takes two arguments.
export const Blackbird = (f: Fn) => (g: Fn) => (a: Fn) => (b: Fn) => f(g(a)(b)); export const BL = Blackbird; export const Chain = BL;
const add = (x: number) => (y: number) => x + y; const double = (x: number) => x * 2; const doubleSum = Blackbird(double)(add); doubleSum(3)(4); // 14