An adapter for functions that take one array. R.unapply(fn) returns a new function that accepts any number of separate arguments, packs them into an array, and passes that array to fn — like rest parameters without writing the arrow function yourself.
Status: stable since Ramda v0.8.0 — not deprecated, experimental, or non-standard.
Syntax
Call R.unapply. Start with this line.
Ramda
R.unapply(fn)
Call
What it does
R.unapply(fn)
Primary signature.
R.unapply(...)
Call the function helper.
Prefer import { unapply } from "ramda" when you want a named import.
Library declarations
Ramda
R.unapply(fn)
Parameters
Parameter
Description
fn
Required. A function that takes one array
Return Value
Return Value
Description
*
A function that takes any number of arguments and calls fn([...args])
Ramda Examples
Example 1 — Official: JSON.stringify
Three loose numbers become one array, which is turned into a JSON string.
Any count. One part or many — the R.pipe always gets an array.
Compatibility
Browser & Runtime Support
R.unapply has been in Ramda since v0.8.0. Ramda’s browser build is plain ES5, so it runs in any modern browser and in Node.js / Bun / Deno with npm install ramda.
✓ Stable · Ramda 0.8.0+
R.unapply()
Built on the plain arguments object, so no special browser API is needed. The examples use ES2015 const, supported by every evergreen browser.
100%With Ramda 0.8.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.unapplyRamda 0.8.0+
Bottom line: Safe for production with Ramda 0.8.0 or newer. The labs on this page use [email protected].
Frequently Asked Questions
R.unapply(fn) takes a function that expects one array and returns a new function that accepts any number of separate arguments. Those arguments are packed into an array and passed to fn, so R.unapply(fn)(a, b) is fn([a, b]). Docs sample: R.unapply(JSON.stringify)(1, 2, 3) //=> '[1,2,3]'.
They are inverses. R.apply(fn, [a, b]) calls fn(a, b) — it spreads an array into arguments. R.unapply(fn)(a, b) calls fn([a, b]) — it packs arguments into an array.
It does the same job. R.unapply(fn) behaves like (...args) => fn(args). Use unapply when you want a point-free, reusable adapter for an existing list function such as R.sum or R.join.
fn receives an empty array. R.unapply(R.sum)() is 0 and R.unapply(JSON.stringify)() is '[]'.
No. It gathers every argument from one call and runs immediately. R.unapply(R.sum)(1) returns 1 right away; it does not wait for more arguments. Its length is 0.
No. R.unapply has been a stable Ramda function helper since v0.8.0 — not deprecated, experimental, or non-standard.