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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AlastairLundy.EnhancedLinq.Memory" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AlastairLundy.EnhancedLinq.Memory" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="AlastairLundy.EnhancedLinq.Memory" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AlastairLundy.EnhancedLinq.Memory --version 0.2.0
                    
#r "nuget: AlastairLundy.EnhancedLinq.Memory, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AlastairLundy.EnhancedLinq.Memory@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AlastairLundy.EnhancedLinq.Memory&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=AlastairLundy.EnhancedLinq.Memory&version=0.2.0
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 169 8/27/2025
0.1.0.1 81 8/22/2025

* Changed root namespace
* Added Span ``Index``extension methods
* Added  Span ``GetRange(IEnumerable<T>`` overload
* Simplified Span ``RemoveRange`` code
* Removed dependency on EnhancedLinq base package