R.curryN(length, fn) returns a curried equivalent of fn that waits for length arguments — not fn.length. Same call styles and R.__ gaps as R.curry, with an arity you choose. Part of Ramda Function since v0.5.0 (stable — not deprecated).
When to prefer it: Rest parameters (...args) and default parameters shrink fn.length. Name the arity with curryN so the helper waits for the right number of slots.
Syntax
Call R.curryN. Start with this line.
Ramda
R.curryN(length, fn)
Call
What it does
R.curryN(length, fn)
Primary signature.
R.curryN(...)
Call the function helper.
Prefer import { curryN } from "ramda" when you want a named import.
Library declarations
Ramda
R.curryN(length, fn)
Parameters
Parameter
Description
length
Required. How many arguments to wait for
fn
Required. Function to wrap (any fn.length)
Return Value
Return Value
Description
*
Curried function with arity length
Ramda Examples
Example 1 — Official sumArgs
Wrap a rest-parameter adder with arity 4. Supply two numbers, then the third, then the fourth.
curryN(3). Three slots are required before add3 runs.
Third arg used.(1)(2)(7) → 10 (default never applied).
Compatibility
Browser & Runtime Support
R.curryN is a Ramda Function helper since v0.5.0. It runs anywhere Ramda runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install ramda.
✓ Stable · Ramda 0.5.0+
R.curryN()
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.5.0+
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.curryNRamda 0.5.0+
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.curryN(length, fn) returns a curried equivalent of fn that waits for length arguments, not fn.length. You can supply arguments one at a time or in groups. The original function runs only when every named slot is present.
const sumArgs = (...args) => R.sum(args); const curriedAddFourNumbers = R.curryN(4, sumArgs); then f = curriedAddFourNumbers(1, 2), g = f(3), g(4) yields 10. Added in v0.5.0. See also R.curry.
R.curry reads fn.length. Rest parameters and default parameters shrink that count, so curry can finish too soon. R.curryN(n, fn) lets you name the arity. R.curry(fn) is effectively R.curryN(fn.length, fn).
No. If g is R.curryN(3, f), the docs list four equivalent styles: g(1)(2)(3), g(1)(2, 3), g(1, 2)(3), and g(1, 2, 3).
R.__ is a placeholder that leaves a gap so you can fill a later argument first. If g is a curried ternary, g(R.__, 2, 3)(1) equals g(1, 2, 3).
No. R.curryN is a stable Ramda function helper from v0.5.0. It is not deprecated, experimental, or non-standard.