Net4x.Collections.Immutable
1.0.0
See the version list below for details.
dotnet add package Net4x.Collections.Immutable --version 1.0.0
NuGet\Install-Package Net4x.Collections.Immutable -Version 1.0.0
<PackageReference Include="Net4x.Collections.Immutable" Version="1.0.0" />
<PackageVersion Include="Net4x.Collections.Immutable" Version="1.0.0" />
<PackageReference Include="Net4x.Collections.Immutable" />
paket add Net4x.Collections.Immutable --version 1.0.0
#r "nuget: Net4x.Collections.Immutable, 1.0.0"
#:package Net4x.Collections.Immutable@1.0.0
#addin nuget:?package=Net4x.Collections.Immutable&version=1.0.0
#tool nuget:?package=Net4x.Collections.Immutable&version=1.0.0
Net4x.Collections.Immutable
Net4x.Collections.Immutable is a lightweight collection of immutable collection types and helpers targeting older .NET Framework versions (3.5, 4.0 and 4.5). It provides back-ported immutable collection APIs and utilities inspired by modern .NET immutable collections so you can write safer, thread-friendly code on legacy platforms.
Key features
- Immutable arrays, dictionaries, stacks and sorted collections.
- API designed to be familiar to developers who have used System.Collections.Immutable.
- Works with .NET Framework 3.5, 4.0 and 4.5 builds included in the solution.
Getting started
- Clone the repository and open the solution in Visual Studio (matching the target framework you need).
- The solution contains project configurations for .NET Framework 3.5, 4.0 and 4.5.
- Build the solution or add a project reference to the
Net4x.Collections.Immutableproject from your application.
Usage example
using System.Collections.Immutable;
// Immutable array
var arr = ImmutableArray.Create(1, 2, 3);
var arr2 = arr.Add(4); // returns a new instance
// Immutable dictionary
var dict = ImmutableDictionary.Create<int, string>();
var dict2 = dict.Add(1, "one");
// Immutable stack
var stack = ImmutableStack<int>.Empty;
var stack2 = stack.Push(10);
Build
- Open the solution in Visual Studio and build the desired target configuration.
- The projects target .NET Framework 3.5 / 4.0 / 4.5; ensure your IDE supports those frameworks.
Contributing
- Contributions and bug reports are welcome. Please open issues or pull requests on the repository.
License
This project is licensed under the Apache-2.0 license. See the LICENSE.txt file for details.
Author
- Piero Viano
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net35 is compatible. net40 is compatible. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 3.5
- Net4x.BaseExtensions (>= 1.3.1.13)
- Net4x.BaseTypes (>= 1.3.1.13)
-
.NETFramework 4.0
- Net4x.BaseExtensions (>= 1.3.1.13)
- Net4x.BaseTypes (>= 1.3.1.13)
-
.NETFramework 4.5
- Net4x.BaseExtensions (>= 1.3.1.13)
- Net4x.BaseTypes (>= 1.3.1.13)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Net4x.Collections.Immutable:
| Package | Downloads |
|---|---|
|
Net4x.Extensions.Primitives
Primitives shared by framework extensions. |
|
|
Net4x.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. |
GitHub repositories
This package is not used by any popular GitHub repositories.