Arrow is a modular set of libraries that build on top of each other to provide increasingly higher level features.
One of our design principles is to keep each library as lean as possible to avoid pulling unnecessary dependencies, specially to support Android development where app size affects performance. You’re free to pick and choose only those libraries that your project needs!
In this doc we’ll describe all the modules that form the core, alongside a list of the most important constructs they include.
The smallest set of datatypes necessary to start in FP, and that other libraries can build upon. The focus here is on API design and abstracting small code patterns.
Multiple extensions functions to work better with function objects and collections.
For function objects the library provides composition, currying, partial application, memoization, pipe operator, complement for predicates, and several more helpers.
For collections, arrow-syntax provides
firstOption, tail, basic list traversal, and tuple addition.
All the basic typeclasses that can compose into a simple program.
This library focuses on expanding the helpers provided by typeclasses to existing constructs, like the system collections.
You can also find more advanced constructs for pure functional programming like the
RWS datatypes, or transformers.
These two libraries include the possible typeclass instances that can be implemented for the datatypes in arrow-core and arrow-data, and some basic types.
Dependencies: arrow-typeclasses, and either arrow-core or arrow-data
Advanced typeclasses to be used in programs using the Tagless-final architecture.
It also includes the instances available for datatypes in both arrow-core and arrow-data
These libraries are hosted inside the arrow repository building on the core, to provide higher level constructs to deal with concepts rather than code abstraction.
Optics is the functional way of handling immutable data and collections in a way that’s boilerplate free and efficient.
It can be used alongside annotation processing to generate simple DSLs that read like imperative code.
For all the new typeclasses it also includes the instances available for basic types and datatypes in both arrow-core and arrow-data.
The effects library abstracts over concurrency frameworks using typeclasses. Additionally it provides its own concurrency primitive, called IO.
Each of these modules provides wrappers over the datatypes in each of the libraries that implement all the typeclasses provided by arrow-effects
Recursion schemes is a construct to work with recursive data structures in a way that decuples structure and data, and allows for ergonomy and performance improvements.
The Free datatype is a way of interpreting domain specific languages from inside your program, including a configurable runner and flexible algebras. This allows optimization of operations like operator fusion or parallelism, while remaining on your business domain.
These libraries focus on meta-programming to generate code that enables other libraries and constructs.
It allows anonating data classes with
@product to enable them to be structurally deconstructed in tuples and heterogeneous lists.