Partially apply a function
JavaScript version
const partial =
(fn, ...a) =>
(...b) =>
fn(...a, ...b);
Examples
const sum = (x, y) => x + y;
const inc = partial(sum, 1);
inc(9); // 10
JavaScript version
const partial =
(fn, ...a) =>
(...b) =>
fn(...a, ...b);
Examples
const sum = (x, y) => x + y;
const inc = partial(sum, 1);
inc(9); // 10