R.always(val) returns a function that always returns val, no matter what arguments you pass. Handy when an API needs a function, but you want a fixed answer.
Stable:R.always has been in Ramda since v0.1.0. It is not deprecated, experimental, or non-standard. Also known as const, constant, or the K combinator.
Syntax
Call R.always. Start with this line.
Ramda
R.always(val)
Call
What it does
R.always(val)
Primary signature.
R.always(...)
Call the function helper.
Prefer import { always } from "ramda" when you want a named import.
Library declarations
Ramda
R.always(val)
Parameters
Parameter
Description
val
Required. Value to wrap (any type)
Arguments to the result
Optional. Accepted and ignored
Return Value
Return Value
Description
*
Function (* → val) that ignores args
Ramda Examples
Example 1 — Official Tee Helper
Build a function that always returns the string 'Tee'.
Mutate via the helper.getObj().n = 99 changes the original.
Same memory. Later calls still return that object.
Docs note. For non-primitives, the value is a reference — clone yourself if you need a copy.
Compatibility
Browser & Runtime Support
R.always is a Ramda Function helper since v0.1.0. It is plain JavaScript — no special browser API. It runs anywhere Ramda loads (CDN, npm, bundler).
✓ Stable · Ramda 0.1.0+
R.always()
Available in every Ramda full build since the earliest releases. Works in evergreen browsers and current Node LTS / Bun / Deno when Ramda is installed.
100%With Ramda 0.1+
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.alwaysRamda 0.1.0+
Bottom line: Safe for production once Ramda is loaded. Use a CDN build such as ramda.min.js in the browser, or npm install ramda for Node. No polyfill is needed beyond shipping Ramda itself.
Frequently Asked Questions
R.always(val) returns a new function that ignores every argument and always returns val. The docs sample is const t = R.always('Tee'); then t() is 'Tee'.
const t = R.always('Tee'); t(); //=> 'Tee'. Added in v0.1.0. In other languages this idea is called const, constant, or the K combinator.
No. For non-primitives the returned function gives back a reference to the original value. If you mutate that object, every later call sees the mutation.
R.identity(x) returns x — it uses the argument. R.always(val)(x) returns val — it ignores the argument. Use identity to pass a value through; use always to replace whatever arrives.
R.T is a function that always returns true (like R.always(true)). R.F always returns false (like R.always(false)). They are handy predicates in ifElse, filter, and cond.
No. R.always is a stable Ramda Function helper from v0.1.0. It is not deprecated, experimental, or non-standard.