Creates a function that is bound to a context (official Ramda docs). Pass a function and a thisObj; every later call runs fn with this fixed to that object. Common use: safe console.log inside R.pipe / R.tap.
Stable since v0.6.0:R.bind is a core Ramda helper — not deprecated, experimental, or non-standard. It pins this only; it does not pre-bind extra arguments like native Function.prototype.bind. Use R.partial for that.
Syntax
Call R.bind. Start with this line.
Ramda
R.bind(fn, thisObj)
Call
What it does
R.bind(fn, thisObj)
Primary signature.
R.bind(...)
Call the function helper.
Prefer import { bind } from "ramda" when you want a named import.
Library declarations
Ramda
R.bind(fn, thisObj)
Parameters
Parameter
Description
fn
Required. Function to run with a fixed this
thisObj
Required. Context object for this
Return Value
Return Value
Description
*
New function; same args as fn, fixed this
Ramda Examples
Example 1 — Official Pipe Logger
Bind a logger and peek with R.tap — same idea as the Ramda docs.
Shared state.counter.n matches — the bound function and object stay linked.
Compatibility
Browser & Runtime Support
R.bind() is ordinary JavaScript once Ramda is loaded. It needs no special browser API — only a JS runtime that can run Ramda (v0.6.0+).
✓ Ramda 0.6.0+ · Any JS runtime
Ramda.js R.bind()
Works in every modern browser and runtime where you can load Ramda (CDN or npm). Internet Explorer needs a build that targets that environment; there is no native IE API to polyfill.
100%With Ramda loaded
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.bind()Universal
Bottom line: Safe in any project that includes Ramda 0.6.0 or later. Load ramda.min.js from a CDN in the browser, or npm install ramda for Node, Bun, and Deno.
Frequently Asked Questions
R.bind(fn, thisObj) returns a new function that calls fn with this permanently set to thisObj. Later calls can pass arguments as usual. The docs sample is const log = R.bind(console.log, console); then R.tap(log) is safe inside a pipe.
const log = R.bind(console.log, console); R.pipe(R.assoc('a', 2), R.tap(log), R.assoc('a', 3))({a: 1}); //=> {a: 3} and logs {a: 2}. Added in v0.6.0. See also R.partial.
Both pin this. Native fn.bind(thisObj, a, b) also prepends extra arguments. R.bind does not: it only takes the function and the context. For pre-filled arguments, use R.partial.
Some hosts require console.log to run with console as this. Passing console.log as a bare callback can throw or no-op. R.bind(console.log, console) makes a callback that always has the right this.
Yes. The type is (* → *) → {*} → (* → *), so R.bind(fn)(thisObj) works the same as R.bind(fn, thisObj).
No. R.bind is a stable Ramda function helper from v0.6.0. It is not deprecated, experimental, or non-standard.