R.transduce(xf, step, acc, list) sends each item through a recipe of steps (the transducerxf, such as map → filter → take), then combines the survivors with step, starting from acc (official Ramda docs). It does the work of several list functions plus R.reduce in one pass, with no in-between arrays.
Added in v0.12.0:R.transduce is stable — not deprecated, experimental, or non-standard. Warning: only functions that work as transducers (like map, filter, take) can go in the recipe; R.sort or R.reverse throw.
Syntax
Call R.transduce. Start with this line.
Ramda
R.transduce(xf, step, acc, list) (curried, 4 arguments) Type (c → c) → ((a, b) → a) → a → [b] → a
Call
What it does
R.transduce(xf, step, acc, list) (curried, 4 arguments) Type (c → c) → ((a, b) → a) → a → [b] → a
Primary signature.
R.transduce(...)
Call the list helper.
Prefer import { transduce } from "ramda" when you want a named import.
Library declarations
Ramda
R.transduce(xf, step, acc, list) (curried, 4 arguments) Type (c → c) → ((a, b) → a) → a → [b] → a
Parameters
Parameter
Description
xf
Required. The transducer: one stage like R.map(fn), or several joined with R.compose
step
Required. Combines (acc, item) into the next accumulator
acc
Required. The starting value; also the result if no items get through
list
Optional. An array or other iterable; omit it to get a reusable function
Return Value
Return Value
Description
*
The value returned by R.transduce().
Ramda Examples
Example 1 — Official Samples
Add 1 and keep two items, then find the first odd number in 0–99 — both samples from the Ramda docs.
Sum. Swapping the step to R.add with 0 turns the same survivors into 2 + 3 = 5.
Compatibility
Browser & Runtime Support
R.transduce() has been in Ramda since v0.12.0. Transducers are plain JavaScript objects and loops, so they work wherever Ramda loads.
✓ Ramda 0.12.0+ · Any JS runtime
Ramda.js R.transduce()
The UMD build (ramda.min.js) is compiled to ES5 syntax, so it runs in Chrome, Firefox, Safari, and Edge. Via npm it works in Node.js, Deno, and Bun with require or import.
100%With Ramda 0.12+
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
R.transduce()Universal
Bottom line: Safe in any project on Ramda 0.12 or newer. Arrays work in every runtime; iterating Sets and other iterables needs an engine with Symbol.iterator (all modern browsers and Node). These labs load [email protected].
Frequently Asked Questions
R.transduce(xf, step, acc, list) sends each item through a composed recipe of steps such as R.map, R.filter, and R.take, then combines the survivors with step, starting from acc. The official sample R.transduce(R.compose(R.map(R.add(1)), R.take(2)), R.flip(R.append), [], [1, 2, 3, 4]) returns [2, 3].
A transducer is a reusable processing recipe, built by composing transducer-capable functions like R.map(fn), R.filter(pred), and R.take(n). It describes what to do with each item but not where the results go; R.transduce or R.into supplies that.
With transducers, R.compose(R.map(f), R.filter(g)) applies f first, then g, to each item. Each transducer wraps the next one, so the left-most step sees the item first. This is the opposite of how R.compose reads for ordinary functions.
The step receives (accumulator, item), but R.append takes (item, list). R.flip swaps the two arguments so the item is appended to the accumulator. Passing R.append directly returns a broken nested array instead of an error.
R.into(acc, xf, list) is a shortcut that picks the right way to add items to an array, string, or object for you. R.transduce makes you pass the step function, so it can produce anything, such as a sum with R.add or the largest value with R.max.
No. R.transduce has been part of Ramda since v0.12.0 and is stable. It is not deprecated, experimental, or non-standard.