UNPKG

1.23 kBJavaScriptView Raw
1var _concat =
2/*#__PURE__*/
3require("./internal/_concat");
4
5var _createPartialApplicator =
6/*#__PURE__*/
7require("./internal/_createPartialApplicator");
8/**
9 * Takes a function `f` and a list of arguments, and returns a function `g`.
10 * When applied, `g` returns the result of applying `f` to the arguments
11 * provided initially followed by the arguments provided to `g`.
12 *
13 * @func
14 * @memberOf R
15 * @since v0.10.0
16 * @category Function
17 * @sig ((a, b, c, ..., n) -> x) -> [a, b, c, ...] -> ((d, e, f, ..., n) -> x)
18 * @param {Function} f
19 * @param {Array} args
20 * @return {Function}
21 * @see R.partialRight, R.curry
22 * @example
23 *
24 * const multiply2 = (a, b) => a * b;
25 * const double = R.partial(multiply2, [2]);
26 * double(2); //=> 4
27 *
28 * const greet = (salutation, title, firstName, lastName) =>
29 * salutation + ', ' + title + ' ' + firstName + ' ' + lastName + '!';
30 *
31 * const sayHello = R.partial(greet, ['Hello']);
32 * const sayHelloToMs = R.partial(sayHello, ['Ms.']);
33 * sayHelloToMs('Jane', 'Jones'); //=> 'Hello, Ms. Jane Jones!'
34 * @symb R.partial(f, [a, b])(c, d) = f(a, b, c, d)
35 */
36
37
38var partial =
39/*#__PURE__*/
40_createPartialApplicator(_concat);
41
42module.exports = partial;
\No newline at end of file