Rimbu Documentation

website·Indexed 32 days ago

https://rimbu.org

A library providing immutable collections and functional programming utilities for TypeScript. Features include immutable List, Set, Map, BiMap, MultiMap, and Table, as well as Stream and AsyncStream implementations, Graph structures (EdgeGraph and ArrowGraph), and a Task API for managing asynchronous operations with support for timeouts and retries.

Tokens
496K
Snippets
4.4K
Records
5.3K
Agent score
60%

What's inside Rimbu

  1. Overview of ArrowGraphHashed

    The ArrowGraphHashed namespace provides a type-invariant immutable directed (arrow) graph. It uses hashed collections internally to maintain connections. The primary interface for this collection is ArrowGraphHashed<N>.
  2. Overview of the HashMap namespace

    The HashMap namespace provides a type-invariant immutable Map of key type K and value type V. In this Map, each key is unique and maps to exactly one value. It serves as the primary entry point for creating HashMap instances and managing their configuration via contexts.
  3. Overview of BiMap<K,V>

    The BiMap<K,V> is an immutable bi-directional map where keys and values have a one-to-one mapping. It is type-invariant and extends FastIterable<T>. It is primarily implemented by BiMap.NonEmpty<K,V>.
    const b1 = BiMap.empty<number, string>();
    const b2 = BiMap.of([1, 'a'], [2, 'b']);
  4. Overview of Rimbu Graph types

    Rimbu provides a variety of immutable graph implementations in the @rimbu/core package. Graphs are categorized by whether they are directed or undirected, and whether their edges carry values.
    Edge propertyNon-valuedValued
    DirectedArrowGraph<N>ArrowValuedGraph<N, V>
    UndirectedEdgeGraph<N>EdgeValuedGraph<N, V>
  5. Overview of @rimbu/multiset implementations

    The @rimbu/multiset package provides various immutable MultiSet implementations where each value can occur multiple times. Available implementations include:

    • MultiSet<T>: The base type-invariant immutable MultiSet.
    • HashMultiSet<T>: A type-invariant immutable MultiSet implementation based on hashing.
    • SortedMultiSet<T>: A type-invariant immutable MultiSet that maintains elements in a sorted order.
    • VariantMultiSet<T>: A type-variant immutable MultiSet implementation.
  6. Overview of ArrowGraphSorted

    ArrowGraphSorted is a type-invariant immutable arrow (directed) graph. Unlike hashed implementations, it maintains connections internally using sorted collections. It is accompanied by the ArrowGraphSorted<N> interface.
  7. Overview of EdgeValuedGraph namespace

    The EdgeValuedGraph namespace provides a type-invariant immutable valued edge (undirected) graph implementation. It includes several key interfaces for graph construction and management:

    • EdgeValuedGraph.Builder<N,V>: A mutable builder used to efficiently create new immutable graph instances.
    • EdgeValuedGraph.Context<UN>: A factory instance used to create related immutable instances and builders.
    • EdgeValuedGraph.NonEmpty<N,V>: A specialized version of the graph that is guaranteed to be non-empty.
    • EdgeValuedGraph.Types: A utility interface providing higher-kinded types for the collection.
  8. Overview of @rimbu/sorted/map-custom for advanced SortedMap configuration

    The @rimbu/sorted/map-custom package provides creators, builders, contexts, and internal implementations for SortedMap. It is designed for scenarios requiring fine-grained control over sorted map internals, such as custom comparators and tree parameters. For standard ordered map usage, the primary @rimbu/sorted and @rimbu/sorted/map APIs are recommended instead.
  9. Overview of @rimbu/channel package

    The @rimbu/channel package provides various channel implementations inspired by Go. It enables the exchange of synchronous messages within an asynchronous context, allowing processes to communicate and synchronize their execution.