Loading search index…
No recent searches
No results for "Query here"
Substitution/dependency injection pattern. Distributes an argument to both a function and its argument function.
export const Starling = (x: Fn) => (y: Fn) => (z: Fn) => x(z)(y(z)); export const S = Starling; export const Substitute = S;
const add = (x: number) => (y: number) => x + y; const double = (x: number) => x * 2; const substitute = Starling(add)(double); substitute(5); // 15