[d24f17c] | 1 | var _curry1 =
|
---|
| 2 | /*#__PURE__*/
|
---|
| 3 | require("./internal/_curry1.js");
|
---|
| 4 |
|
---|
| 5 | var liftN =
|
---|
| 6 | /*#__PURE__*/
|
---|
| 7 | require("./liftN.js");
|
---|
| 8 | /**
|
---|
| 9 | * "lifts" a function of arity >= 1 so that it may "map over" a list, Function or other
|
---|
| 10 | * object that satisfies the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply).
|
---|
| 11 | *
|
---|
| 12 | * @func
|
---|
| 13 | * @memberOf R
|
---|
| 14 | * @since v0.7.0
|
---|
| 15 | * @category Function
|
---|
| 16 | * @sig (*... -> *) -> ([*]... -> [*])
|
---|
| 17 | * @param {Function} fn The function to lift into higher context
|
---|
| 18 | * @return {Function} The lifted function.
|
---|
| 19 | * @see R.liftN
|
---|
| 20 | * @example
|
---|
| 21 | *
|
---|
| 22 | * const madd3 = R.lift((a, b, c) => a + b + c);
|
---|
| 23 | *
|
---|
| 24 | * madd3([100, 200], [30, 40], [5, 6, 7]); //=> [135, 136, 137, 145, 146, 147, 235, 236, 237, 245, 246, 247]
|
---|
| 25 | *
|
---|
| 26 | * const madd5 = R.lift((a, b, c, d, e) => a + b + c + d + e);
|
---|
| 27 | *
|
---|
| 28 | * madd5([10, 20], [1], [2, 3], [4], [100, 200]); //=> [117, 217, 118, 218, 127, 227, 128, 228]
|
---|
| 29 | */
|
---|
| 30 |
|
---|
| 31 |
|
---|
| 32 | var lift =
|
---|
| 33 | /*#__PURE__*/
|
---|
| 34 | _curry1(function lift(fn) {
|
---|
| 35 | return liftN(fn.length, fn);
|
---|
| 36 | });
|
---|
| 37 |
|
---|
| 38 | module.exports = lift; |
---|