source: node_modules/ramda/es/lift.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

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