System.Collections.Immutable 9.0.0-preview.5.24306.7
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 |
---|---|
OpenIddict.Abstractions
Abstractions and primitives used by the OpenIddict components.
|
146 |
HtmlSanitizer
Cleans HTML from constructs that can be used for cross-site scripting (XSS)
|
130 |
libphonenumber-csharp
C# port of Google's common Java, C++ and Javascript library for parsing, formatting, storing and validating international phone numbers. http://code.google.com/p/libphonenumber/
|
127 |
Microsoft.CodeAnalysis.Common
A shared package used by the Microsoft .NET Compiler Platform ("Roslyn").
Do not install this package manually, it will be added as a prerequisite by other packages that require it.
More details at https://aka.ms/roslyn-packages
This package was built from the source at https://github.com/dotnet/roslyn/commit/e595ee276d14e14bfb3eb323fb57f2aa668bddea
|
117 |
System.Reflection.Metadata
This packages provides a low-level .NET (ECMA-335) metadata reader. It's geared for performance and is the ideal choice for building higher-level libraries that intend to provide their own object model, such as compilers.
Commonly Used Types:
System.Reflection.Metadata.MetadataReader
System.Reflection.PortableExecutable.PEReader
|
73 |
Microsoft.Extensions.Http.Diagnostics
Telemetry support for HTTP Client.
|
51 |
Microsoft.Extensions.Diagnostics.ExceptionSummarization
Lets you retrieve exception summary information.
|
51 |
Microsoft.Extensions.Telemetry
Provides canonical implementations of telemetry abstractions.
|
48 |
Microsoft.ML
ML.NET is a cross-platform open-source machine learning framework which makes machine learning accessible to .NET developers.
|
17 |
Microsoft.ML
ML.NET is a cross-platform open-source machine learning framework which makes machine learning accessible to .NET developers.
|
10 |
Humanizer.Core
Humanizer core package that contains the library and the neutral language (English) resources
|
10 |
Microsoft.NETCore
Provides a set of packages that can be used when building portable libraries on .NETCore based platforms. \r\n TFS ID: 1599443, GitHub SHA: https://github.com/dotnet/corefx/tree/eede273a4dfabcea608621f5e1bbf8ad00584cfb
|
10 |
Microsoft.ML.DataView
Contains the IDataView system which is a set of interfaces and components that provide efficient, compositional processing of schematized data for machine learning and advanced analytics applications.
|
9 |
OpenTelemetry
OpenTelemetry .NET SDK
|
8 |
System.Reflection.Metadata
This packages provides a low-level .NET (ECMA-335) metadata reader and writer. It's geared for performance and is the ideal choice for building higher-level libraries that intend to provide their own object model, such as compilers.
Commonly Used Types:
System.Reflection.Metadata.MetadataReader
System.Reflection.PortableExecutable.PEReader
System.Reflection.Metadata.Ecma335.MetadataBuilder
System.Reflection.PortableExecutable.PEBuilder
System.Reflection.PortableExecutable.ManagedPEBuilder
When using NuGet 3.x this package requires at least version 3.4.
|
8 |
Stripe.net
Stripe.net is a sync/async .NET 4.5+ client, and a portable class library for the Stripe API. (Official Library)
|
8 |
OpenIddict
Versatile OpenID Connect stack for .NET.
Note: this metapackage only references the generic core, server and validation packages.
To use these features on ASP.NET Core or OWIN/Katana/ASP.NET 4.x, reference the OpenIddict.AspNetCore or OpenIddict.Owin package.
|
7 |
Microsoft.CodeAnalysis.Common
A shared package used by the Microsoft .NET Compiler Platform ("Roslyn"). Do not install this package manually, it will be added as a prerequisite by other packages that require it.
Supported Platforms:
- .NET Framework 4.5
- Windows 8
- Portable Class Libraries
|
7 |
Microsoft.NETCore.App
A set of .NET API's that are included in the default .NET Core application model.
811c3ce6c01229f0eaead96f3eb10112a9066b34
When using NuGet 3.x this package requires at least version 3.4.
|
7 |
.NET Framework 4.6.2
- System.Memory (>= 4.5.5)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
.NET 8.0
- No dependencies.
.NET 9.0
- No dependencies.
.NET Standard 2.0
- System.Memory (>= 4.5.5)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)