Ramda.js R.lift() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Function

Definition

R.lift(fn) turns a plain n-ary function into one that works over lists (or other Apply values). It builds every combination of arguments from those lists, then runs fn on each combo. Part of Ramda Function since v0.7.0 (stable — not deprecated).

Warning: Arity comes from fn.length. Rest-parameter helpers have length === 0 — use R.liftN for those. R.lift(fn) is R.liftN(fn.length, fn).

Syntax

Call R.lift. Start with this line.

Ramda
R.lift(fn)
CallWhat it does
R.lift(fn)Primary signature.
R.lift(...)Call the function helper.

Prefer import { lift } from "ramda" when you want a named import.

Library declarations
Ramda
R.lift(fn)

Parameters

ParameterDescription
fnRequired. Plain function; arity from fn.length
ListsRequired. One list (or Apply) per argument of fn

Return Value

Return ValueDescription
*Function that takes n lists / Apply values

Ramda Examples

Example 1 — Official madd3

Add every combination from three lists.

Ramda
const madd3 = R.lift((a, b, c) => a + b + c);

console.log(madd3([100, 200], [30, 40], [5, 6, 7]));
// → [135, 136, 137, 145, 146, 147, 235, 236, 237, 245, 246, 247]
Try It Yourself

How It Works

  1. Arity 3. The adder has length 3, so lift expects three lists.
  2. Combinations. Every pick from list1 × list2 × list3 is added.
  3. Count. 2 × 2 × 3 = 12 results.
  4. Order. First list outermost — all 100+… before 200+….

Example 2 — Official-Style madd5

Same idea with five arguments and five lists.

Ramda
const madd5 = R.lift((a, b, c, d, e) => a + b + c + d + e);

console.log(madd5([10, 20], [1], [2, 3], [4], [100, 200]));
// → [117, 217, 118, 218, 127, 227, 128, 228]
Try It Yourself

How It Works

  1. Arity 5. Five parameters → five lists.
  2. Product size. 2 × 1 × 2 × 1 × 2 = 8 sums.
  3. Innermost last. 100 / 200 alternate first.
  4. Same tool. Only the function arity (and list count) grew.

Example 3 — Lift R.add and R.inc

Binary add over two lists; unary inc over one list.

Ramda
console.log(R.lift(R.add)([1, 2], [10, 20]));
// → [11, 21, 12, 22]

console.log(R.lift(R.inc)([1, 2, 3]));
// → [2, 3, 4]
Try It Yourself

How It Works

  1. Binary. R.add.length is 2 → two lists; every pair is added.
  2. Order. 1+10, 1+20, then 2+10, 2+20.
  3. Unary. R.inc over one list behaves like a map.
  4. Rule. For a single list and a unary fn, R.map is clearer.

Example 4 — R.lift vs R.liftN

Named parameters work with lift; rest args need an explicit arity.

Ramda
function add3(a, b, c) {
  return a + b + c;
}
function addN() {
  return R.sum(Array.prototype.slice.call(arguments));
}

console.log(R.lift(add3)([1, 10], [2], [3]));
// → [6, 15]

console.log(R.liftN(3, addN)([1, 10], [2], [3]));
// → [6, 15]
Try It Yourself

How It Works

  1. add3.length is 3. Lift waits for three lists → [6, 15].
  2. addN.length is 0. Plain lift would use arity 0 and ignore lists.
  3. liftN(3, …). You name the arity so three lists still work.
  4. Same sums. Both helpers produce 1+2+3 and 10+2+3.

Example 5 — Greeting Combinations

Build every prefix × suffix pair with R.lift(R.concat).

Ramda
console.log(R.lift(R.concat)(["Hi", "Hey"], ["!", "?"]));
// → ["Hi!", "Hi?", "Hey!", "Hey?"]
Try It Yourself

How It Works

  1. Binary concat. Two string lists → every pair joined.
  2. First prefix. All Hi… results come before Hey….
  3. Suffixs vary. ! then ? for each prefix.
  4. Use case. Small cartesian products of strings or tags.

Browser & Runtime Support

R.lift is a Ramda Function helper since v0.7.0. It runs anywhere Ramda runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install ramda.

✓ Stable · Ramda 0.7.0+

R.lift()

Available in [email protected] full builds once the library is loaded. Works in evergreen browsers and current Node LTS when Ramda is installed. No extra browser API is required.

100% With Ramda 0.7.0+
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
R.lift Ramda 0.7.0+

Bottom line: Safe for production once Ramda is loaded (CDN or npm). Prefer a modular build if you tree-shake. Use liftN when fn.length does not match the arity you need.

Frequently Asked Questions

R.lift(fn) takes a function of arity 1 or more and returns a new function that maps over lists (or other Fantasy-Land Apply values) instead of plain values. The docs sample is R.lift((a, b, c) => a + b + c)([100, 200], [30, 40], [5, 6, 7]) //=> [135, 136, 137, 145, 146, 147, 235, 236, 237, 245, 246, 247]. Added in v0.7.0.
const madd3 = R.lift((a, b, c) => a + b + c); madd3([100, 200], [30, 40], [5, 6, 7]); //=> [135, 136, 137, 145, 146, 147, 235, 236, 237, 245, 246, 247]. Every combination of one number from each list is added. A five-argument sibling madd5 is also in the docs.
R.map runs one unary function over one list. R.lift runs an n-ary function over n lists, producing every combination (a cartesian product), then applying the function to each combo.
R.lift(fn) is R.liftN(fn.length, fn). Use lift when the function's .length is the arity you want. Use liftN when the function is variadic (rest args) so .length is 0 or too small.
The first list is the outermost loop, the last list is the innermost. For madd3([100, 200], [30, 40], [5, 6, 7]) you get 100+30+5, then 100+30+6, then 100+30+7, then 100+40+5, and so on.
No. R.lift is a stable Ramda function helper from v0.7.0. It is not deprecated, experimental, or non-standard.

Next: R.liftN()

Learn how to lift with an explicit arity when fn.length is wrong.

R.liftN() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful