R.apex

R.apex is a functional library based on Apex, inspired by Lodash and Ramda.js.

Why R.apex?

Apex is a pure object-oriented lanuage, and it does not provide any builtin features to make functional programming easier. The biggest obstacle in Apex is that functions(methods) are not First Class Citizens, the building blocks in a functional world. R.apex aims to pave the way for functional programming, and makes every attempt to mimic the functional features in Apex as much as possible. So we can adopt a functional paradigm based on R.apex.

Collection Utility

R.apex offers a ton of utitlies on Apex collections like lists, sets and maps, to help you handle daily coding tasks.

Function Object

R.apex provides support to Func objects, which paves the way for functional programming in Apex.

Function Composition

By adopting functional paradigm, R.apex is inherently built with function composition in mind.

It's easier than you think

If you are familiar with functional programming, it takes you only minutes to pick up R.apex.

If you are not, you can also use simple functions that you understand. It's just a utility library, and you decide how much you apply it.

Fluent API

R.apex honors the style of function call chaining, which greatly improves usability and code readability.

Fluent API

Collection Support

R.apex has various functions available to support collection manipulations.

Collection Support

Function Composition

R.apex provides a rich set of tools to help you compose functions to reuse your code.

Function Composition