[d24f17c] | 1 | var _concat =
|
---|
| 2 | /*#__PURE__*/
|
---|
| 3 | require("./internal/_concat.js");
|
---|
| 4 |
|
---|
| 5 | var _createPartialApplicator =
|
---|
| 6 | /*#__PURE__*/
|
---|
| 7 | require("./internal/_createPartialApplicator.js");
|
---|
| 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(3); //=> 6
|
---|
| 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 |
|
---|
| 38 | var partial =
|
---|
| 39 | /*#__PURE__*/
|
---|
| 40 | _createPartialApplicator(_concat);
|
---|
| 41 |
|
---|
| 42 | module.exports = partial; |
---|