What is Ramda?
It emphasizes a purer functional style. Immutability and side-effect free functions are at the heart of its design philosophy. This can help you get the job done with simple, elegant code.
There are already several excellent libraries with a functional flavor. Typically, they are meant to be general-purpose toolkits, suitable for working in multiple paradigms. Ramda has a more focused goal. We wanted a library designed specifically for a functional programming style, one that makes it easy to create functional pipelines, one that never mutates user data.
The primary distinguishing features of Ramda are:
- Ramda emphasizes a purer functional style. Immutability and side-effect free functions are at the heart of its design philosophy. This can help you get the job done with simple, elegant code.
- Ramda functions are automatically curried. This allows you to easily build up new functions from old ones simply by not supplying the final parameters.
- The parameters to Ramda functions are arranged to make it convenient for currying. The data to be operated on is generally supplied last.
The last two points together make it very easy to build functions as sequences of simpler functions, each of which transforms the data and passes it along to the next. Ramda is designed to support this style of coding.
- Introducing Ramda by Buzz de Cafe
- Why Ramda? by Scott Sauyet
- Favoring Curry by Scott Sauyet
- Why Curry Helps by Hugh Jackson
- Hey Underscore, You’re Doing It Wrong! by Brian Lonsdorf
- Thinking in Ramda by Randy Coulman
Functional programming is in good part about immutable objects and side-effect free functions. While Ramda does not enforce this, it enables such style to be as frictionless as possible.
Last but not least, Ramda strives for performance. A reliable and quick implementation wins over any notions of functional purity.