| Operator | Summary |
| AssertCount | Asserts that a source sequence contains a given count of elements. |
| Batch | Batches the source sequence into sized buckets. |
| Concat | Returns a sequence consisting of the head element and the given tail elements. This operator uses deferred execution and streams its results. |
| Consume | Completely consumes the given sequence. This method uses immediate execution, and doesn't store any data during execution. |
| DistinctBy | Returns all distinct elements of the given source, where "distinctness" is determined via a projection and the default eqaulity comparer for the projected type. |
| EquiZip | Returns a projection of tuples, where each tuple contains the N-th element from each of the argument sequences. |
| ForEach | Immediately executes the given action on each element in the source sequence. |
| Generate | Returns a sequence of values consecutively generated by a generator function. |
| GenerateByIndex | Returns a sequence of values based on indexes. |
| MaxBy | Returns the maximal element of the given sequence, based on the given projection. |
| MinBy | Returns the minimal element of the given sequence, based on the given projection. |
| Pad | Pads a sequence with default values if it is narrower (shorter in length) than a given width. |
| Pipe | Executes the given action on each element in the source sequence and yields it. |
| Prepend | Prepends a single value to a sequence. |
| PreScan | Performs a pre-scan (exclusive prefix sum) on a sequence of elements. |
| Scan | Peforms a scan (inclusive prefix sum) on a sequence of elements. |
| SingleOrFallback | Returns the single element in the given sequence, or the result of executing a fallback delegate if the sequence is empty. |
| TakeEvery | Returns every N-th element of a source sequence. |
| ToDelimitedString | Creates a delimited string from a sequence of values. The delimiter used depends on the current culture of the executing thread. |
| Trace | Traces the elements of a source sequence for diagnostics. |
| Zip | Returns a projection of tuples, where each tuple contains the N-th element from each of the argument sequences. |
| ZipLongest | Returns a projection of tuples, where each tuple contains the N-th element from each of the argument sequences. |
What is the difference between your MaxBy? and MinBy?, and the the various Enumerable.Max<TSource, TResult> Method (IEnumerable<TSource>, Func<TSource, TResult>)?
And Enumerable.Min... of course.
From what I can tell, MaxBy? and MinBy? return the source item that has the maximal or minimal projection whereas the Max and Min you refer to return the maximal or minimal projection itself. That's my interpretation but one of the developers can probably explain it better.
Ooh, that makes sense actually. Do these work with Queryables and Linq2SQL?
How is "Pipe" different from .Select()?
Select can be used for what Pipe does by specifying a lambda that does an action and returns the original item, but Pipe is designed to avoid the additional boilerplate by just allowing the "does an action" part to be given.
For example:
var results = myCollection.Select(x=> {
});becomes...
var results = myCollection.Pipe(x => GoDoSomethingToX(x));
Really like this project guys.
Awesome, brilliant
I'd like to make a single value into an IEnumerable<T> or T. I repeatedly need those in my unit tests.
And while I'm at it: A NuGet? package would be really nice.
To turn a single value into an IEnumerable<T>, you can use Enumerable.Repeat(value, 1).
Or you can just do new { value }
;)
In your example of the difference between Select and Pipe the syntax you use for the Pipe version is also valid syntax for the Select method. I do not see what the Pipe method is doing that is any different.
The Pipe example can actually collapse to a method group: var results = myCollection.Pipe(GoDoSomethingToX);
Rather than calling it "DistinctBy?", I would call it "FirstBy?", since it's basically returning the first item of each "distinct match", right?
How it the ToDelimitedString? different than string.Join?