AlastairLundy.EnhancedLinq.Memory
0.2.0
Prefix Reserved
dotnet add package AlastairLundy.EnhancedLinq.Memory --version 0.2.0
NuGet\Install-Package AlastairLundy.EnhancedLinq.Memory -Version 0.2.0
<PackageReference Include="AlastairLundy.EnhancedLinq.Memory" Version="0.2.0" />
<PackageVersion Include="AlastairLundy.EnhancedLinq.Memory" Version="0.2.0" />
<PackageReference Include="AlastairLundy.EnhancedLinq.Memory" />
paket add AlastairLundy.EnhancedLinq.Memory --version 0.2.0
#r "nuget: AlastairLundy.EnhancedLinq.Memory, 0.2.0"
#:package AlastairLundy.EnhancedLinq.Memory@0.2.0
#addin nuget:?package=AlastairLundy.EnhancedLinq.Memory&version=0.2.0
#tool nuget:?package=AlastairLundy.EnhancedLinq.Memory&version=0.2.0
EnhancedLinq.Memory
A set of Immediate Mode LINQ lambda-style extensions specifically designed for working with Spans and System.Memory data structures in .NET.
License
This project is licensed under the MPL 2.0 License. See the LICENSE file for more details.
Features
- Immediate Mode LINQ Extensions: Most extensions in this package operate in immediate mode, meaning they execute as soon as they are called, making them suitable for use with
Span<T>
.
Installation
You can install the EnhancedLinq.Memory package via NuGet Package Manager with the following command:
Install-Package AlastairLundy.EnhancedLinq.Memory
Alternatively, you can add it to your project file:
<PackageReference Include="AlastairLundy.EnhancedLinq.Memory" Version="0.1.0" />
Usage
Here are some examples of how to use the extensions provided by EnhancedLinq.Memory:
Example 1: Using Immediate LINQ Extensions
using AlastairLundy.EnhancedLinq.Memory.Immediate;
Span<int> numbers = new int[] { 1, 2, 3, 4, 5 };
// Using the Sum extension
int sum = numbers.Sum(); // Returns 15
// Using the Where extension
Span<int> evenNumbers = numbers.Where(n => n % 2 == 0); // Returns { 2, 4 }
// Using the Select extension
Span<string> result = evenNumbers.Select(n => n.ToString());
Console.WriteLine(string.Join(", ", result)); // Outputs: 2, 4
Example 2: Working with Memory<T>
using EnhancedLinq.Memory;
Memory<int> memoryNumbers = new Memory<int>(new int[] { 1, 2, 3, 4, 5 });
// Using the Average extension
double average = memoryNumbers.Average(); // Returns 3.0
Contributing
Contributions are welcome! If you would like to contribute to EnhancedLinq.Memory, please follow the contributing guide
Support
For any issues or feature requests, please open an issue in the GitHub repository.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- AlastairLundy.DotExtensions (>= 8.2.0)
- AlastairLundy.DotPrimitives.Collections (>= 3.1.0)
-
net9.0
- AlastairLundy.DotExtensions (>= 8.2.0)
- AlastairLundy.DotPrimitives.Collections (>= 3.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
* Changed root namespace
* Added Span ``Index``extension methods
* Added Span ``GetRange(IEnumerable<T>`` overload
* Simplified Span ``RemoveRange`` code
* Removed dependency on EnhancedLinq base package