SuperLinq 4.8.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package SuperLinq --version 4.8.0                
NuGet\Install-Package SuperLinq -Version 4.8.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="SuperLinq" Version="4.8.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SuperLinq --version 4.8.0                
#r "nuget: SuperLinq, 4.8.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.
// Install SuperLinq as a Cake Addin
#addin nuget:?package=SuperLinq&version=4.8.0

// Install SuperLinq as a Cake Tool
#tool nuget:?package=SuperLinq&version=4.8.0                

SuperLinq

LINQ to Objects is missing a few desirable features.

This project enhances LINQ to Objects with extra methods, in a manner which keeps to the spirit of LINQ.

SuperLinq is available for download and installation as NuGet packages.

Usage

SuperLinq can be used in one of two ways. The simplest is to just import the SuperLinq namespace and all extension methods become instantly available for you to use on the types they extend (typically some instantiation of IEnumerable<T>).

Apart from extension methods, SuperLinq also offers regular static method that generate (instead of operating on) sequences, like Unfold, Random, Sequence and others.

Migration from MoreLINQ

In most case, migration should be easy:

  1. Remove the nuget reference to MoreLINQ and add a reference to SuperLinq.
  2. Replace any using MoreLinq; with using SuperLinq;
  3. Remove any using MoreLinq.Extensions.*

This is because SuperLinq has been updated to be side-by-side compatible with .NET Core 3.1 and .NET 5.0/6.0.

Breaking Changes

Framework Support

Support for earlier frameworks has been dropped. The earliest version supported by SuperLinq is .NET Core 3.1.

System.Interactive

SuperLinq now holds a dependency on System.Interactive. This is because some methods from SuperLinq overlap functions with the same and occasionally the same name. To reduce conflicts, SuperLinq will defer to System.Interactive for these methods when possible. Methods removed include: .Repeat(), .Scan(), .ForEach(), .Memoize().

Acquire

Acquire has been removed. It was used internally to support other operators, but improved data structures have been introduced to better support them.

AwaitQuery/Observable/Experimental Operators

These operators have been removed, as they do not fit the model of the other SuperLinq operators.

Backsert

This method has been obsoleted in favor of a new overload for .Insert() that receives an Index parameter, which covers the same behavior.

Batch

The .Batch() method has been obsoleted in favor of the .NET method .Chunk() or the System.Interactive method .Buffer().

CountDown

An additional overload has been added that returns a stream of (TSource item, int? count).

FullJoin

This method has been obsoleted in favor of a new method .FullOuterJoin(), which has more options and capabilities.

Lag/Lead

Additional overloads have been added for Lag/Lead that return streams of (TSource cur, TSource lag/lead).

LeftJoin

This method has been obsoleted in favor of a new method .LeftOuterJoin(), which has more options and capabilities.

MaxBy/MinBy

MaxBy and MinBy have been removed. These methods are superceded by PartialSort and DensePartialSort, and conflict with new .NET 6.0 MaxBy/MinBy methods that operate slightly differently. PartialSort will ignore ties and return at most K elements. DensePartialSort will return the top K groups of elements including ties.

OrderedMerge

This method has been obsoleted in favor of a new method .FullOuterJoin(), which has more options and capabilities.

Pairwise

Pairwise has been removed as it overlaps behavior with both .Lag() and .Window()

PartialSort

The sorting behavior of .PartialSort() has been changed slightly, as it now uses a stable sorting algorithm. This means that items that have the same value (or key) will return in the same order that they were originally encountered in the stream. This is a minor change from old sorting behavior.

Rank

The behavior and return type of Rank has been updated:

  • Previously, Rank would rank according the highest value by default, opposite to the sorting.
    • Now, Rank ranks according to the lowest value, matching the sorting
  • Previously, Rank would return a simple list of integers matching the original items
    • Now, Rank returns a sorted list of items with their rank
  • Previously, Rank would rank each group with a sequential rank value
    • Now, Rank ranks each group according to how many total items have been encountered in the stream thus far.
    • DenseRank will rank each group with a seqential value.

All of these changes are made to bring Rank/DenseRank with the behavior expressed for Rank/DenseRank in SQL systems (Sql Server, PostgreSQL, etc.)

RightJoin

This method has been obsoleted in favor of a new method .RightOuterJoin(), which has more options and capabilities.

RunLengthEncode

The return type has been changed from a stream of KeyValuePair<T, int> to a stream of (T value, int count)

Scan

The .Scan() method has been renamed to .ScanEx() in order to avoid conflict with the System.Interactive version of the method. However, the behavior of the System.Interactive version differs slightly in that it does not return the seed/first element. The new .ScanEx() method maintains the original behavior.

.NET Versions

Base library is supported on .NET Core 3.1 and .NET 5.0+.

Documentation

Detailed documentation on the operators is available here.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on SuperLinq:

Package Downloads
SuperLinq.Async

This project enhances Async LINQ to Objects with the following methods: AggregateRight, AssertCount, AtLeast, AtMost, Choose, CollectionEqual, CompareCount, ConcurrentMerge, Consume, CountBetween, CountBy, CountDown, DenseRank, DenseRankBy, DistinctBy, ElementAt, EndsWith, Exactly, ExceptBy, FallbackIfEmpty, FillBackward, FillForward, Fold, From, Generate, GroupAdjacent, Index, IndexBy, Insert, Interleave, OrderBy, Pad, PadStart, PartialSort, PartialSortBy, Random, Rank, RankBy, RunLengthEncode, ScanBy, ScanRight, Segment, Sequence, SkipUntil, SortedMerge, Split, StartsWith, TagFirstLast, Take, TakeEvery, TakeUntil, ThenBy, Where, Window, WindowLeft, WindowRight, ZipLongest, ZipMap, ZipShortest

Hussy.Net

A minified dialect of .NET languages designed with code golf in mind.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on SuperLinq:

Repository Stars
recyclarr/recyclarr
Automatically sync TRaSH Guides to your Sonarr and Radarr instances
Version Downloads Last updated
6.2.0 11,803 7/17/2024
6.1.0 5,591 5/24/2024
6.0.1 6,838 4/30/2024
6.0.0 676 4/10/2024
6.0.0-preview.1 101 2/26/2024
5.4.0 13,917 11/27/2023
5.4.0-preview.1 108 11/22/2023
5.3.0 434 11/14/2023
5.2.0 4,840 7/8/2023
5.1.0 4,460 5/26/2023
5.0.0 702 4/28/2023
4.8.0 719 2/21/2023
4.7.0 587 1/30/2023
4.6.0 604 12/24/2022
4.5.0 827 11/28/2022
4.4.0 2,749 10/3/2022
4.3.0 621 9/28/2022
4.2.0 2,412 8/25/2022
4.1.0 564 8/12/2022
4.1.0-preview.2 121 7/25/2022
4.1.0-preview.1 121 7/21/2022
4.0.0 663 7/20/2022
4.0.0-preview.7 131 7/9/2022
4.0.0-preview.6 191 7/4/2022
4.0.0-preview.5 121 6/28/2022
4.0.0-preview.4 126 6/20/2022
4.0.0-preview.3 104 6/20/2022
4.0.0-preview.2 107 6/15/2022
4.0.0-preview.1 119 6/13/2022
4.0.0-preview.0.16 110 6/13/2022