System.Collections.Immutable 10.0.0-preview.6.25358.103

About

This package provides collections that are thread safe and guaranteed to never change their contents, also known as immutable collections. Like strings, any methods that perform modifications will not change the existing instance but instead return a new instance. For efficiency reasons, the implementation uses a sharing mechanism to ensure that newly created instances share as much data as possible with the previous instance while ensuring that operations have a predictable time complexity.

The System.Collections.Immutable library is built-in as part of the shared framework in .NET Runtime. The package can be installed when you need to use it in other target frameworks.

How to Use

using System.Collections.Immutable;

// Create immutable set of strings
ImmutableHashSet<string> colors = ImmutableHashSet.Create("Red", "Green", "Blue");

// Create a new set by adding and removing items from the original set
ImmutableHashSet<string> colorsModified = colors.Remove("Red").Add("Orange");

foreach (string s in colorsModified)
{
    Console.WriteLine(s);
}

/* Example output:
 Blue
 Green
 Orange
 */

Main Types

The main types provided by this library are:

  • System.Collections.Immutable.ImmutableArray
  • System.Collections.Immutable.ImmutableArray<T>
  • System.Collections.Immutable.ImmutableDictionary
  • System.Collections.Immutable.ImmutableDictionary<TKey,TValue>
  • System.Collections.Immutable.ImmutableHashSet
  • System.Collections.Immutable.ImmutableHashSet<T>
  • System.Collections.Immutable.ImmutableList
  • System.Collections.Immutable.ImmutableList<T>
  • System.Collections.Immutable.ImmutableQueue
  • System.Collections.Immutable.ImmutableQueue<T>
  • System.Collections.Immutable.ImmutableSortedDictionary
  • System.Collections.Immutable.ImmutableSortedDictionary<TKey,TValue>
  • System.Collections.Immutable.ImmutableSortedSet
  • System.Collections.Immutable.ImmutableSortedSet<T>
  • System.Collections.Immutable.ImmutableStack
  • System.Collections.Immutable.ImmutableStack<T>
  • System.Collections.Frozen.FrozenDictionary
  • System.Collections.Frozen.FrozenDictionary<TKey, TValue>
  • System.Collections.Frozen.FrozenSet
  • System.Collections.Frozen.FrozenSet<T>

Additional Documentation

Feedback & Contributing

System.Collections.Immutable is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Showing the top 20 packages that depend on System.Collections.Immutable.

Packages Downloads
Akka.Persistence
Persistence actor support for Akka.NET
262
Akka.Persistence
Persistence actor support for Akka.NET
250
Akka.Persistence
Persistence actor support for Akka.NET
218
Akka.Persistence
Persistence actor support for Akka.NET
215
Akka.Persistence
Persistence actor support for Akka.NET
212
Akka.Streams
Reactive stream support for Akka.NET
210
Akka.Persistence
Persistence actor support for Akka.NET
210
Akka.Persistence
Persistence actor support for Akka.NET
209
Akka.Remote
Remote actor support for Akka.NET
208
Akka.Persistence
Persistence actor support for Akka.NET
208
Akka.Streams
Reactive stream support for Akka.NET
207
Akka.Persistence
Persistence actor support for Akka.NET
206
Akka.Streams
Reactive stream support for Akka.NET
206

https://go.microsoft.com/fwlink/?LinkID=799421

.NET Framework 4.6.2

.NET 8.0

  • No dependencies.

.NET 9.0

  • No dependencies.

.NET 10.0

  • No dependencies.

.NET Standard 2.0

Version Downloads Last updated
10.0.0-preview.6.25358.103 1 07/22/2025
10.0.0-preview.5.25277.114 7 06/07/2025
10.0.0-preview.4.25258.110 6 05/18/2025
10.0.0-preview.3.25171.5 10 04/17/2025
10.0.0-preview.2.25163.2 14 03/23/2025
10.0.0-preview.1.25080.5 11 02/27/2025
9.0.7 2 07/12/2025
9.0.6 5 06/15/2025
9.0.5 7 05/19/2025
9.0.4 9 04/17/2025
9.0.3 14 03/15/2025
9.0.2 16 02/17/2025
9.0.1 16 01/19/2025
9.0.0 17 11/19/2024
9.0.0-rc.2.24473.5 15 10/09/2024
9.0.0-rc.1.24431.7 16 09/24/2024
9.0.0-preview.7.24405.7 17 08/17/2024
9.0.0-preview.6.24327.7 21 07/11/2024
9.0.0-preview.5.24306.7 22 06/13/2024
9.0.0-preview.4.24266.19 15 05/25/2024
9.0.0-preview.3.24172.9 14 04/17/2024
9.0.0-preview.2.24128.5 13 03/19/2024
9.0.0-preview.1.24080.9 18 02/17/2024
8.0.0 24 02/17/2024
8.0.0-rc.2.23479.6 22 12/19/2023
8.0.0-rc.1.23419.4 23 12/19/2023
8.0.0-preview.7.23375.6 22 12/19/2023
8.0.0-preview.6.23329.7 25 12/19/2023
8.0.0-preview.5.23280.8 22 12/19/2023
8.0.0-preview.4.23259.5 21 08/31/2023
8.0.0-preview.3.23174.8 22 05/18/2023
8.0.0-preview.2.23128.3 31 03/23/2023
8.0.0-preview.1.23110.8 52 04/13/2023
7.0.0 30 05/04/2023
7.0.0-rc.2.22472.3 22 08/29/2023
7.0.0-rc.1.22426.10 35 08/26/2023
7.0.0-preview.7.22375.6 14 08/29/2023
7.0.0-preview.6.22324.4 25 04/07/2023
7.0.0-preview.5.22301.12 38 04/03/2023
7.0.0-preview.4.22229.4 45 03/24/2023
7.0.0-preview.3.22175.4 42 03/25/2023
7.0.0-preview.2.22152.2 55 04/03/2023
7.0.0-preview.1.22076.8 21 08/29/2023
6.0.2-mauipre.1.22102.15 25 08/28/2023
6.0.2-mauipre.1.22054.8 37 05/24/2023
6.0.1 16 12/10/2024
6.0.0 42 03/20/2023
6.0.0-rc.2.21480.5 47 08/30/2023
6.0.0-rc.1.21451.13 60 03/29/2023
6.0.0-preview.7.21377.19 32 08/28/2023
6.0.0-preview.6.21352.12 59 04/18/2023
6.0.0-preview.5.21301.5 17 08/26/2023
6.0.0-preview.4.21253.7 23 04/06/2023
6.0.0-preview.3.21201.4 27 08/26/2023
6.0.0-preview.2.21154.6 41 04/26/2023
6.0.0-preview.1.21102.12 32 03/25/2023
5.0.0 82 02/11/2021
5.0.0-rc.2.20475.5 35 05/18/2023
5.0.0-rc.1.20451.14 57 04/06/2023
5.0.0-preview.8.20407.11 23 08/30/2023
5.0.0-preview.7.20364.11 22 04/03/2023
5.0.0-preview.6.20305.6 38 04/11/2023
5.0.0-preview.5.20278.1 37 04/08/2023
5.0.0-preview.4.20251.6 27 05/19/2023
5.0.0-preview.3.20214.6 23 08/26/2023
5.0.0-preview.2.20160.6 37 05/04/2023
5.0.0-preview.1.20120.5 60 08/13/2023
1.7.1 121 07/17/2020
1.7.0 61 11/04/2021
1.7.0-preview3.19551.4 19 03/31/2023
1.7.0-preview2.19523.17 58 04/09/2023
1.7.0-preview1.19504.10 58 07/14/2023
1.6.0 28 06/14/2023
1.6.0-rc1.19456.4 21 08/28/2023
1.6.0-preview9.19421.4 22 08/30/2023
1.6.0-preview9.19416.11 51 04/20/2023
1.6.0-preview8.19405.3 31 03/30/2023
1.6.0-preview7.19362.9 42 08/28/2023
1.6.0-preview6.19303.8 64 03/25/2023
1.6.0-preview6.19264.9 34 04/09/2023
1.6.0-preview5.19224.8 60 04/10/2023
1.6.0-preview4.19212.13 24 04/08/2023
1.6.0-preview3.19128.7 66 04/05/2023
1.6.0-preview.19073.11 45 08/02/2023
1.6.0-preview.18571.3 55 04/08/2023
1.5.0 47 07/30/2020
1.5.0-rc1 39 04/02/2023
1.5.0-preview2-26406-04 21 08/24/2023
1.5.0-preview1-26216-02 59 04/11/2023
1.4.0 128 11/29/2019
1.4.0-preview2-25405-01 60 03/24/2023
1.4.0-preview1-25305-02 42 04/22/2023
1.3.1 77 12/30/2020
1.3.0 61 01/17/2020
1.3.0-preview1-24530-04 71 04/03/2023
1.2.0 115 11/26/2019
1.2.0-rc2-24027 67 03/24/2023
1.1.38-beta-23516 47 03/25/2023
1.1.38-beta-23409 45 08/27/2023
1.1.38-beta-23225 34 08/27/2023
1.1.37 39 04/04/2023
1.1.37-beta-23109 19 08/24/2023
1.1.37-beta-23019 68 04/18/2023
1.1.36 70 04/11/2022
1.1.34-rc 32 08/31/2023
1.1.33-beta 46 03/30/2023
1.1.32-beta 59 05/06/2023