System.Collections.Immutable is a high-performance .NET library providing a suite of immutable collection types, such as arrays, lists, stacks, queues, dictionaries, and sets. These collections are designed for scenarios where data structures need to be shared safely across threads or require non-destructive updates, making them ideal for functional programming patterns.
While F# has its own built-in immutable collections, System.Collections.Immutable collections are engineered for performance and scalability, especially in concurrent and multi-threaded environments. They use advanced algorithms to minimize memory allocations and maximize efficiency when creating modified copies of collections.
FSharp.Collections.Immutable provides idiomatic F# bindings for these .NET collections, allowing F# developers to leverage their performance and safety benefits with a familiar F#-style API.
FlatList
(ImmutableArray
)ImmutableList
Stack
(ImmutableStack
)Queue
(ImmutableQueue
)HashMap
(ImmutableDictionary
)SortedMap
(ImmutableSortedDictionary
)HashSet
(ImmutableHashSet
)SortedSet
(ImmutableSortedSet
)IIndexedSeq
(IReadOnlyList
)FSharp.Collections.Immutable enables F# developers to use these performant, thread-safe, and feature-rich immutable collections in a natural and idiomatic way.