Immutable-js - Immutable persistent data collections for Javascript which increase efficiency and simplicity

  •        150

Immutable data cannot be changed once created, leading to much simpler application development, no defensive copying, and enabling advanced memoization and change detection techniques with simple logic. Persistent data presents a mutative API which does not update the data in-place, but instead always yields new updated data.

immutable.js provides many Persistent Immutable data structures including: List, Stack, Map, OrderedMap, Set, OrderedSet and Record. These data structures are highly efficient on modern JavaScript VMs by using structural sharing via hash maps tries and vector tries as popularized by Clojure and Scala, minimizing the need to copy or cache data.



Related Projects

list - 🐆 An immutable list with unmatched performance and a comprehensive functional API.

  •    TypeScript

A fast immutable list with a functional API. List is a purely functional alternative to arrays. It is an implementation of a fast persistent sequence data structure. Compared to JavaScript's Array List has three major benefits.

Capsule - The Capsule Hash Trie Collections Library

  •    Java

Capsule aims to become a full-fledged (immutable) collections library for Java 8+ that is solely built around persistent tries. The library is designed for standalone use and for being embedded in domain-specific languages. Capsule still has to undergo some incubation before it can ship as a well-rounded collection library. Nevertheless, the code is stable and performance is solid.

pyrsistent - Persistent/Immutable/Functional data structures for Python

  •    Python

Pyrsistent is a number of persistent collections (by some referred to as functional data structures). Persistent in the sense that they are immutable. All methods on a data structure that would normally mutate it instead return a new copy of the structure containing the requested updates. The original structure is left untouched.

rpds - Rust Persistent Data Structures

  •    Rust

Rust Persistent Data Structures provides fully persistent data structures with structural sharing. Your classic functional list.

bifurcan - impure functional data structures

  •    Java

This library provides high-quality Java implementations of mutable and immutable data structures, each sharing a common API. Rather than using the existing collection interfaces in java.util such as List or Map, it provides its own interfaces (IList, IMap, ISet) that provide functional semantics - each update to a collection returns a reference to a new collection.

immu - A TINY, fail-fast, lazy, immutable Javascript objects library.

  •    Javascript

A TINY, fail-fast, lazy, "naked", simple immutable Javascript objects library. Immu does not attempt to add functionality to Arrays, introduce complex data structures like Map and Set, or provide a complete solution with cursors and stores. Immu is meant to be the simplest possible solution to providing immutable objects while maintaining the native API for those objects (including Array methods).

PCollections - A Persistent Java Collections Library

  •    Java

A Persistent Java Collections Library. PCollections serves as a persistent and immutable analogue of the Java Collections Framework. This includes efficient, thread-safe, generic, immutable, and persistent stacks, maps, vectors, sets, and bags, compatible with their Java Collections counterparts.

immer - Postmodern immutable and persistent data structures for C++

  •    C++

immer is a library of persistent and immutable data structures written in C++. These enable whole new kinds of architectures for interactive and concurrent programs of striking simplicity, correctness, and performance. In the last few years, there has been a growing interest in immutable data structures, motivated by the horizontal scaling of our processing power and the ubiquity of highly interactive systems. Languages like Clojure and Scala provide them by default, and implementations for JavaScript like Mori and Immutable.js are widely used, specially in combination with modern UI frameworks like React.

icepick - Utilities for treating frozen JavaScript objects as persistent immutable collections

  •    Javascript

Utilities for treating frozen JavaScript objects as persistent immutable collections. Object.freeze() is a quick and easy way to get immutable collections in plain JavaScript. If you recursively freeze an object hierarchy, you have a nice structure you can pass around without fear of mutation. The problem is that if you want to modify properties inside this hierarchical collection, you have to return a new copy with the properties changed.

baobab - JavaScript persistent and optionally immutable data tree with cursors.

  •    Javascript

Baobab is a JavaScript persistent and immutable (at least by default) data tree supporting cursors and enabling developers to easily navigate and monitor nested data through events. It is mainly inspired by functional zippers (such as Clojure's ones) and by Om's cursors.

Knapsack - Collection pipeline library for PHP

  •    PHP

Knapsack is a collection library for PHP >= 5.6 that implements most of the sequence operations proposed by Clojures sequences plus some additional ones. All its features are available as functions (for functional programming) and as a collection pipeline object methods. The heart of Knapsack is its Collection class. However its every method calls a simple function with the same name that does the actual heavy lifting. These are located in DusanKasan\Knapsack namespace and you can find them here. Collection is a Traversable implementor (via IteratorAggregate) that accepts Traversable object, array or even a callable that produces a Traversable object or array as constructor argument. It provides most of Clojures sequence functionality plus some extra features. It is also immutable - operations preformed on the collection will return new collection (or value) instead of modifying the original collection.

Paguro - Immutable Collections and Functional Transformations for the JVM

  •    Java

Immutable Clojure collections and a Transformation abstraction for Java 8+, immutably, type-safely, and with good performance. It provide support for RRB Tree, which is an immutable List (like Clojure's PersistentVector) that also supports random inserts, deletes, and can be split and joined back together in logarithmic time.

immutable-devtools - Chrome Dev Tools custom formatter for Immutable-js values

  •    Javascript

The Immutable library is fantastic, but inspecting immutable collections in Chrome's Dev Tools is awkward. You only see the internal data structure, not the logical contents. For example, when inspecting the contents of an Immutable List, you'd really like to see the items in the list.Chrome (v47+) has support for custom "formatters". A formatter tells Chrome's Dev Tools how to display values in the Console, Scope list, etc. This means we can display Lists, Maps and other collections, in a much better way.

hamster - Efficient, Immutable, Thread-Safe Collection classes for Ruby

  •    Ruby

Efficient, immutable, and thread-safe collection classes for Ruby. Hamster provides 6 Persistent Data Structures: Hash, Vector, Set, SortedSet, List, and Deque (which works as an immutable queue or stack).

omniscient - A library providing an abstraction for React components that allows for fast top-down rendering embracing immutable data for js

  •    Javascript

We can happily announce that as of React 16.6, Omniscient.js can enjoy retirement after a job well done. The new React.memo API can for most cases replace the Omniscient decorator with your own areEqual function. It's not exactly the same, but we feel that it is close enough for most cases. Thanks for supporting Omniscient all these years. Do fast top-down rendering embracing immutable data and functional programming.

seamless-immutable - Immutable data structures for JavaScript which are backwards-compatible with normal JS Arrays and Objects

  •    Javascript

Immutable JS data structures which are backwards-compatible with normal Arrays and Objects. Use them in for loops, pass them to functions expecting vanilla JavaScript data structures, etc.

immutable - Immutable collections for Go

  •    Go

This repository contains immutable collection types for Go. It includes List, Map, and SortedMap implementations. Immutable collections can provide efficient, lock free sharing of data by requiring that edits to the collections return new collections. The collection types in this library are meant to mimic Go built-in collections such asslice and map. The primary usage difference between Go collections and immutable collections is that immutable collections always return a new collection on mutation so you will need to save the new reference.

react-cursor - Immutable state for React.js

  •    Javascript

Cursors are a tool for working with recursive or deeply nested data, immutably. react-cursor is a javascript port of an abstraction that I first saw in ClojureScript. This implementation is decoupled from any rendering library and is very small. Cursors are useful in UI programming, because UIs are tree shaped and naturally have tree-shaped state. Cursors let your app hold all its state in one place at the root of the UI tree; thus the root is stateful, and all downtree views are stateless.

Vavr - Object-functional language extension to Java

  •    Java

Vavr is an object-functional language extension to Java 8, which aims to reduce the lines of code and increase code quality. It provides persistent collections, functional abstractions for error handling, concurrent programming, pattern matching and much more.

NuclearJS - Reactive Flux built with ImmutableJS data structures. Framework agnostic.

  •    Javascript

NuclearJS is a traditional Flux architecture built with ImmutableJS data structures. The goal of NuclearJS is to provide a way to model data that is easy to reason about and decouple at very large scale. The framework should be implemented functionally wherever appropriate. This reduces incidental complexity and pairs well with Immutability.