[Home] >  Function >  Partially apply a function

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