R.converge(after, functions) builds a new function that runs every branching function on the same arguments, then passes those results to after. Part of Ramda Function since v0.4.2 (stable — not deprecated).
Stable: Added in Ramda v0.4.2. Not deprecated, experimental, or non-standard. See also R.useWith.
Syntax
Call R.converge. Start with this line.
Ramda
R.converge(after, functions)
Call
What it does
R.converge(after, functions)
Primary signature.
R.converge(...)
Call the function helper.
Prefer import { converge } from "ramda" when you want a named import.
Library declarations
Ramda
R.converge(after, functions)
Parameters
Parameter
Description
after
Required. Called with each branch result, in array order
functions
Required. Array of branching functions (same args each)
Return Value
Return Value
Description
*
New function; arity = longest branch
Ramda Examples
Example 1 — Official Average
Divide sum by length. Both branches read the same list.
Same steps. Both call sum, then length, then divide.
Named helper. Converge keeps the pattern reusable and point-free.
Inline form. The lambda is fine for a one-off.
Choose. Prefer converge when you already have named branches and a named combiner.
Compatibility
Browser & Runtime Support
R.converge is a Ramda Function helper since v0.4.2. It runs anywhere Ramda runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install ramda.
✓ Stable · Ramda 0.4.2+
R.converge()
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.4.2+
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.convergeRamda 0.4.2+
Bottom line: Safe for production once Ramda is loaded (CDN or npm). Prefer a modular build if you tree-shake. IE and very old engines are fine only if your Ramda bundle targets them.
Frequently Asked Questions
R.converge(after, functions) returns a new function. Each branching function is called with the same arguments. Those results become the arguments to after, which produces the final value.
Yes. Every branching function is applied to the same input. That is the opposite of R.useWith, which transforms each argument separately before the main function.
converge feeds branch results into one function (after). applySpec puts each result on a named key of an object. Same fan-out idea; different shape of the answer.
The same as the longest branching function. If both R.sum and R.length are unary, average is unary. If the branches are R.add and R.subtract, the result is binary.
No. R.converge is a stable Ramda function helper from v0.4.2. It is not deprecated, experimental, or non-standard.