Ramda Adjunct
Ramda Adjunct

Ramda Adjunct

Written on

Ramda Adjunct is the most popular and most comprehensive set of functional utilities for use with Ramda, providing a variety of useful, well-tested functions with excellent documentation. This article describes the history of Ramda Adjunct's creation.

Functional point-free programming is all about composition. When I’m building an application nowadays, I use composition from top to bottom. I compose functions to create modules, modules to compose features, and features to compose applications. For composing functions themselves, I use functional libraries. Namely, my two most favorite lodash and Ramda.

While using these functional libraries, I found out that in every new project I was working on, I tend to create the same set of aggregate functions that I missed either from lodash or Ramda. Let me demonstrate this in a code snippet:

1
2
3
4
5
const { isString, negate } = require('lodash/fp');
const { isNil, complement } = require('ramda');

const isNotString = negate(isString);
const isNotNil = complement(isNil);

After realizing that I had to redefine these functions in every project, I opened my browser and searched for extensions to lodash and Ramda. I decided to narrow my search to Ramda only because it is missing more functions related to my use-cases.

My search criteria were:

  • timestamp of the last commit
  • 100% test coverage
  • quality documentation similar to Ramda

The results:

I could not find anything solid I could use. I found multiple fragmented libraries; some didn’t have tests at all, some did not have any documentation, some were buggy, and some were focused on Promises, etc… Of course, I could use a combination of multiple libraries, but again, I will not build software on libraries without any test coverage.

Hence Ramda Adjunct was born.

Ramda Adjunct is based on three main principles:

  • centralization
  • 100% test coverage
  • impeccable documentation

Centralization

All Ramda recipes and aggregate utils not present in Ramda are centralized here. There is no more need for everybody to create their own utils in their own codebases.

100% test coverage

Creating custom aggregate utils or implementing recipes from the Ramda wiki creates the defectiveness problem. The problem is caused by the absence of any tests. Ramda Adjunct keeps 100% code coverage and mimics the Ramda test patterns.

Impeccable documentation

You cannot call a library great without excellent documentation. Ramda Adjunct generates its documentation directly from its codebase and uses patterns found in Ramda and Lodash to document its API.

What are the future plans?

My first priority for the near feature is to absorb obsolete and no longer maintained Ramda Cookbook implementation and implement all Type related functions that I’m missing in Ramda. After that, I would like to continue absorbing other dead libraries. Ramda Adjunct repo is ready to receive pull requests. If you have some recipes you would like to share with the community, please issue a pull request or create an issue on GitHub.

Fork me on GitHub