I have to say it: I like ReScript. Its features and tooling provide a great developer experience. I wish it was my main tool at work, however…it isn't, since most of the commercial projects I have worked on recently have been built with TypeScript. This is fully understandable from a business perspective because it is easier to find developers who are familiar with TypeScript ¯\_(ツ)_/¯.
Below are my opinions and thoughts on FP libraries that I have previously used on a daily basis at work, and I fully understand if you disagree with them.
Ramda is a mature project, it contains tons of utility functions, and has great, detailed documentation.
pipe function feels unnatural (for example:
pipe(fn1, fn2)(value)), TypeScript support is neglected (the type inference simply doesn’t work well), and the
data-last approach makes code less readable.
Rambda is super fast, and I really mean it: it’s difficult (but not impossible) to beat
rambda in terms of overall performance!
Similar problems to
Remeda provides a
data-first approach, which is more natural and developer friendly.
remeda has good documentation, and its TypeScript support is great.
According to my benchmark results,
remeda is the slowest compared to the other libraries. Its use of lazy evaluation also makes it unclear how to use some utility functions within a pipeline.
Comment: It's been my first choice for a long time.
TS Belt ⬇️
Until…I decided to build
ts-belt combines all of the good things you can find in other similar libraries: the developer friendly
data-first approach, good documentation, great TypeScript support, and last but not least, it's as fast as
rambda (actually, it's even faster 🙊). Under the hood it uses ReScript and the
genType it automatically generates TypeScript signatures.
ts-belt is also easily extendable because most of the build process is done automatically.
- 👀 provides more readable code, due to the
- ✨ supports
- 🛡 helps you write safer code with
- 🎯 all functions return immutable data (no side-effects)
- 🌲 tree-shakeable
- 📝 fully documented