liveBook · Manning

Ramda

As explained in Functional Programming in JavaScript

The conventional global namespace object through which Ramda exposes its functions.

Ramda is a JavaScript functional library whose functions are conventionally accessed through the R namespace. It supports loosely coupled pipelines and modular programs built from independent functions. section 4.0 section 4.3

Its most developed use here is currying: R.curry turns a function with several parameters into a sequence of calls that returns another function until all arguments arrive. section 4.3

Choosing a data source with a curried function

const fetchStudentFromDb = R.curry(function (db, ssn) { return find(db, ssn); }); const fetchStudentFromArray = R.curry(function (arr, ssn) { return arr[ssn]; }); const findStudent = useDb ? fetchStudentFromDb(db) : fetchStudentFromArray(arr); findStudent('444-44-4444'); The first call fixes the data source; the returned function accepts a student identifier. The same pattern also creates reusable logging functions by partially applying R.curry(logger). section 4.3

How Functional Programming in JavaScript covers it

How deep it goes
Explains the R namespace and demonstrates currying with lookup, type-checking, and logging examples, without surveying the wider library.
Examples
Demonstrates R.curry with student lookup, type validation through R.is, and reusable Log4js logger configuration.
What it assumes
Assumes basic JavaScript function calls and parameters, then explains missing arguments, closures, and currying from first principles.
What you can do after
Apply Ramda via R.curry to specialize functions incrementally and select interchangeable implementations.
How it connects
Connects Ramda with currying, partial application, closures, functional composition, function combinators, and modular programming.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Functional Programming in JavaScript. The section links point to the parts of the book it draws on.