Loading search index…
No recent searches
No results for "Query here"
Composes a binary function with a unary function on the right. Useful for applying a transformation to one argument before passing both to a binary function.
export const Dove = (x: Fn) => (y: Fn) => (z: Fn) => (w: Fn) => x(y)(z(w)); export const D = Dove;
const multiply = (x: number) => (y: number) => x * y; const square = (x: number) => x * x; const multiplyBySquare = Dove(multiply)(2)(square); multiplyBySquare(3); // 18