An immutable list with unmatched performance and a comprehensive functional API. List is a purely functional alternative to arrays. It is an implementation of a fast persistent sequence data structure. Compared to JavaScript Array List has three major benefits. List is immutable. This makes it safer and better suited for functional programming. It doesn't tempt you with an imperative API and accidental mutations won't be a source of bugs. Since List doesn't allow mutations it can be heavily optimized for pure operations. This makes List much faster for functional programming than arrays. List has a large API of useful functions and offers both chainable methods and curried functions to suit every taste. List follows the naming conventions common in functional programming and has arguments ordered for currying/partial application.
Features
- List has all the functions known from Array and a lot of additional functions that'll save the day once you need them.
- List is a carefully optimized implementation of the highly efficient data-structure relaxed radix balanced trees. We have an extensive benchmark suite to ensure optimal performance
- In addition to the base API List offers additional API styles. Import list/methods to get chainable methods or alterntively import list/curried to get a version of the API where every function is curried. Both variants are 100% TypeScript compatible
- Instead of offering a wealth of data structures List has a tight focus on being the best immutable list possible. It doesn't do everything but is designed to work well with the libraries you're already using
- If you know Ramda you already know how to use List. List was designed to integrate seamlessly with Ramda
- List is implemented in TypeScript. It makes full use of TypeScript features to provide accurate types that covers the entire library