├── .gitattributes ├── m ├── scan-by.md ├── prepend.md ├── split.md ├── batch.md ├── trace.md ├── scan.md ├── transpose.md ├── exclude.md ├── full-join.md ├── left-join.md ├── take-every.md ├── flatten.md ├── fold.md ├── pipe.md ├── repeat.md ├── right-join.md ├── slice.md ├── pre-scan.md ├── append.md ├── insert.md ├── rank.md ├── skip-last.md ├── generate.md ├── move.md ├── pad.md ├── shuffle.md ├── for-each.md ├── take-last.md ├── assert-count.md ├── full-group-join.md ├── generate-by-index.md ├── lag.md ├── max-by.md ├── min-by.md ├── partial-sort-by.md ├── sequence.md ├── assert.md ├── index.md ├── lead.md ├── window.md ├── exactly.md ├── partial-sort.md ├── random.md ├── random-double.md ├── rank-by.md ├── at-most.md ├── partition.md ├── segment.md ├── order-by.md ├── permutations.md ├── subsets.md ├── at-least.md ├── from.md ├── random-subset.md ├── starts-with.md ├── consume.md ├── pad-start.md ├── group-adjacent.md ├── then-by.md ├── await.md ├── except-by.md ├── interleave.md ├── fallback-if-empty.md ├── count-between.md ├── skip-until.md ├── scan-right.md ├── sorted-merge.md ├── take-until.md ├── cartesian.md ├── count-by.md ├── fill-backward.md ├── fill-forward.md ├── compare-count.md ├── to-array-by-index.md ├── distinct-by.md ├── to-delimited-string.md ├── ordered-merge.md ├── window-left.md ├── traverse-depth-first.md ├── unfold.md ├── to-hash-set.md ├── window-right.md ├── run-length-encode.md ├── traverse-breadth-first.md ├── pairwise.md ├── tag-first-last.md ├── to-data-table.md ├── count-down.md ├── memoize.md ├── backsert.md ├── to-lookup.md ├── await-completion.md ├── choose.md ├── to-dictionary.md ├── equi-zip.md ├── aggregate-right.md ├── zip-longest.md ├── zip-shortest.md ├── ends-with.md ├── aggregate.md └── acquire.md ├── code ├── TryMoreLinq.csproj ├── Console.cs └── Program.cs ├── .editorconfig ├── CONTRIBUTING.md ├── setup.md ├── .gitignore └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | *.sh eol=lf 5 | 6 | # Custom for Visual Studio 7 | *.cs diff=csharp 8 | 9 | # Standard to msysgit 10 | *.doc diff=astextplain 11 | *.DOC diff=astextplain 12 | *.docx diff=astextplain 13 | *.DOCX diff=astextplain 14 | *.dot diff=astextplain 15 | *.DOT diff=astextplain 16 | *.pdf diff=astextplain 17 | *.PDF diff=astextplain 18 | *.rtf diff=astextplain 19 | *.RTF diff=astextplain 20 | -------------------------------------------------------------------------------- /m/scan-by.md: -------------------------------------------------------------------------------- 1 | 2 | # ScanBy 3 | 4 | Applies an accumulator function over sequence element keys, returning the keys 5 | along with intermediate accumulator states. 6 | 7 | ```c# --destination-file ../code/Program.cs --region ScanBy --project ../code/TryMoreLinq.csproj 8 | // TODO add example 9 | ``` 10 | 11 | --- 12 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 13 | improvement. Alternatively, you can also [report an issue you see][issue]. 14 | 15 | 16 | [edit]: https://github.com/morelinq/try/edit/master/scan-by.md 17 | [issue]: https://github.com/morelinq/try/issues/new?title=ScanBy 18 | -------------------------------------------------------------------------------- /code/TryMoreLinq.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | 8 6 | netcoreapp2.1 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /m/prepend.md: -------------------------------------------------------------------------------- 1 | # Prepend 2 | 3 | Prepends a single value to a sequence 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/prepend.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=Prepend 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Prepend__1.htm 20 | -------------------------------------------------------------------------------- /m/split.md: -------------------------------------------------------------------------------- 1 | # Split 2 | 3 | Splits the source sequence by a separator. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/split.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=Split 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Split.htm 20 | -------------------------------------------------------------------------------- /m/batch.md: -------------------------------------------------------------------------------- 1 | # Batch 2 | 3 | Batches the source sequence into sized buckets. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/batch.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=Batch 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Batch.htm 20 | -------------------------------------------------------------------------------- /m/trace.md: -------------------------------------------------------------------------------- 1 | # Trace 2 | 3 | Traces the elements of a source sequence for diagnostics. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/trace.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=Trace 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Trace.htm 20 | -------------------------------------------------------------------------------- /m/scan.md: -------------------------------------------------------------------------------- 1 | # Scan 2 | 3 | Peforms a scan (inclusive prefix sum) on a sequence of elements. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/scan.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=Scan 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Scan.htm 20 | -------------------------------------------------------------------------------- /m/transpose.md: -------------------------------------------------------------------------------- 1 | # Transpose 2 | 3 | Transposes the rows of a sequence into columns. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/transpose.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=Transpose 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Transpose__1.htm 20 | -------------------------------------------------------------------------------- /m/exclude.md: -------------------------------------------------------------------------------- 1 | # Exclude 2 | 3 | Excludes elements from a sequence starting at a given index 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/exclude.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=Exclude 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Exclude__1.htm 20 | -------------------------------------------------------------------------------- /m/full-join.md: -------------------------------------------------------------------------------- 1 | # FullJoin 2 | 3 | Performs a full outer join between two sequences. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/full-join.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=FullJoin 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_FullJoin.htm 20 | -------------------------------------------------------------------------------- /m/left-join.md: -------------------------------------------------------------------------------- 1 | # LeftJoin 2 | 3 | Performs a left outer join between two sequences. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/left-join.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=LeftJoin 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_LeftJoin.htm 20 | -------------------------------------------------------------------------------- /m/take-every.md: -------------------------------------------------------------------------------- 1 | # TakeEvery 2 | 3 | Returns every N-th element of a source sequence 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/take-every.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=TakeEvery 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_TakeEvery__1.htm 20 | -------------------------------------------------------------------------------- /m/flatten.md: -------------------------------------------------------------------------------- 1 | # Flatten 2 | 3 | Flattens a sequence containing arbitrarily-nested sequences. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/flatten.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=Flatten 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Flatten.htm 20 | -------------------------------------------------------------------------------- /m/fold.md: -------------------------------------------------------------------------------- 1 | # Fold 2 | 3 | Returns the result of applying a function to a sequence with 1 to 16 elements. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/fold.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=Fold 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Fold.htm 20 | -------------------------------------------------------------------------------- /m/pipe.md: -------------------------------------------------------------------------------- 1 | # Pipe 2 | 3 | Executes the given action on each element in the source sequence and yields it 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/pipe.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=Pipe 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Pipe__1.htm 20 | -------------------------------------------------------------------------------- /m/repeat.md: -------------------------------------------------------------------------------- 1 | # Repeat 2 | 3 | Repeats the sequence indefinitely or a specific number of times. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/repeat.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=Repeat 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Repeat.htm 20 | -------------------------------------------------------------------------------- /m/right-join.md: -------------------------------------------------------------------------------- 1 | # RightJoin 2 | 3 | Performs a right outer join between two sequences. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/right-join.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=RightJoin 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_RightJoin.htm 20 | -------------------------------------------------------------------------------- /m/slice.md: -------------------------------------------------------------------------------- 1 | # Slice 2 | 3 | Extracts elements from a sequence at a particular zero-based starting index 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/slice.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=Slice 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Slice__1.htm 20 | -------------------------------------------------------------------------------- /m/pre-scan.md: -------------------------------------------------------------------------------- 1 | # PreScan 2 | 3 | Performs a pre-scan (exclusive prefix sum) on a sequence of elements 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/pre-scan.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=PreScan 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_PreScan__1.htm 20 | -------------------------------------------------------------------------------- /m/append.md: -------------------------------------------------------------------------------- 1 | # Append 2 | 3 | Returns a sequence consisting of the head element and the given tail elements. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/append.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=Append 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Append__1.htm 20 | -------------------------------------------------------------------------------- /m/insert.md: -------------------------------------------------------------------------------- 1 | # Insert 2 | 3 | Inserts the elements of a sequence into another sequence at a specified index. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/insert.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=Insert 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Insert__1.htm 20 | -------------------------------------------------------------------------------- /m/rank.md: -------------------------------------------------------------------------------- 1 | # Rank 2 | 3 | Ranks each item in the sequence in descending ordering using a default 4 | comparer. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/rank.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=Rank 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Rank.htm 21 | -------------------------------------------------------------------------------- /m/skip-last.md: -------------------------------------------------------------------------------- 1 | # SkipLast 2 | 3 | Bypasses a specified number of elements at the end of the sequence. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/skip-last.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=SkipLast 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_SkipLast__1.htm 20 | -------------------------------------------------------------------------------- /m/generate.md: -------------------------------------------------------------------------------- 1 | # Generate 2 | 3 | Returns a sequence of values consecutively generated by a generator function 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/generate.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=Generate 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Generate__1.htm 20 | -------------------------------------------------------------------------------- /m/move.md: -------------------------------------------------------------------------------- 1 | # Move 2 | 3 | Returns a sequence with a range of elements in the source sequence 4 | moved to a new offset. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/move.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=Move 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Move__1.htm 21 | -------------------------------------------------------------------------------- /m/pad.md: -------------------------------------------------------------------------------- 1 | # Pad 2 | 3 | Pads a sequence with default values if it is narrower (shorter in length) than 4 | a given width. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/pad.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=Pad 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Pad.htm 21 | -------------------------------------------------------------------------------- /m/shuffle.md: -------------------------------------------------------------------------------- 1 | # Shuffle 2 | 3 | Returns a sequence of elements in random order from the original sequence. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/shuffle.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=Shuffle 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Shuffle.htm 20 | -------------------------------------------------------------------------------- /m/for-each.md: -------------------------------------------------------------------------------- 1 | # ForEach 2 | 3 | Immediately executes the given action on each element in the source sequence. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/for-each.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=ForEach 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_ForEach.htm 20 | -------------------------------------------------------------------------------- /m/take-last.md: -------------------------------------------------------------------------------- 1 | # TakeLast 2 | 3 | Returns a specified number of contiguous elements from the end of a sequence 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/take-last.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=TakeLast 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_TakeLast__1.htm 20 | -------------------------------------------------------------------------------- /m/assert-count.md: -------------------------------------------------------------------------------- 1 | # AssertCount 2 | 3 | Asserts that a source sequence contains a given count of elements. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/assert-count.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=AssertCount 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_AssertCount.htm 20 | -------------------------------------------------------------------------------- /m/full-group-join.md: -------------------------------------------------------------------------------- 1 | # FullGroupJoin 2 | 3 | Performs a Full Group Join between the and sequences. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/full-group-join.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=FullGroupJoin 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_FullGroupJoin.htm 20 | -------------------------------------------------------------------------------- /m/generate-by-index.md: -------------------------------------------------------------------------------- 1 | # GenerateByIndex 2 | 3 | Returns a sequence of values based on indexes 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/generate-by-index.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=GenerateByIndex 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_GenerateByIndex__1.htm 20 | -------------------------------------------------------------------------------- /m/lag.md: -------------------------------------------------------------------------------- 1 | # Lag 2 | 3 | Produces a projection of a sequence by evaluating pairs of elements separated 4 | by a negative offset. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/lag.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=Lag 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Lag.htm 21 | -------------------------------------------------------------------------------- /m/max-by.md: -------------------------------------------------------------------------------- 1 | # MaxBy 2 | 3 | Returns the maxima (maximal elements) of the given sequence, based on the 4 | given projection. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/max-by.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=MaxBy 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_MaxBy.htm 21 | -------------------------------------------------------------------------------- /m/min-by.md: -------------------------------------------------------------------------------- 1 | # MinBy 2 | 3 | Returns the minima (minimal elements) of the given sequence, based on the 4 | given projection. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/min-by.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=MinBy 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_MinBy.htm 21 | -------------------------------------------------------------------------------- /m/partial-sort-by.md: -------------------------------------------------------------------------------- 1 | # PartialSortBy 2 | 3 | Combines `OrderBy` and `Take` in a single operation. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/partial-sort-by.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=PartialSortBy 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_PartialSortBy.htm 20 | -------------------------------------------------------------------------------- /m/sequence.md: -------------------------------------------------------------------------------- 1 | # Sequence 2 | 3 | Generates a sequence of integral numbers within the (inclusive) specified range. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/sequence.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=Sequence 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Sequence.htm 20 | -------------------------------------------------------------------------------- /m/assert.md: -------------------------------------------------------------------------------- 1 | # Assert 2 | 3 | Asserts that all elements of a sequence meet a given condition otherwise 4 | throws an exception. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/assert.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=Assert 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Assert.htm 21 | -------------------------------------------------------------------------------- /m/index.md: -------------------------------------------------------------------------------- 1 | # Index 2 | 3 | Returns a sequence of where the key is the zero-based index of the value in 4 | the source sequence. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/index.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=Index 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Index.htm 21 | -------------------------------------------------------------------------------- /m/lead.md: -------------------------------------------------------------------------------- 1 | # Lead 2 | 3 | Produces a projection of a sequence by evaluating pairs of elements separated 4 | by a positive offset. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/lead.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=Lead 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Lead.htm 21 | -------------------------------------------------------------------------------- /m/window.md: -------------------------------------------------------------------------------- 1 | # Window 2 | 3 | Processes a sequence into a series of subsequences representing a windowed 4 | subset of the original 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/window.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=Window 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Window__1.htm 21 | -------------------------------------------------------------------------------- /m/exactly.md: -------------------------------------------------------------------------------- 1 | # Exactly 2 | 3 | Determines whether or not the number of elements in the sequence is equals 4 | to the given integer. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/exactly.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=Exactly 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Exactly__1.htm 21 | -------------------------------------------------------------------------------- /m/partial-sort.md: -------------------------------------------------------------------------------- 1 | # PartialSort 2 | 3 | Combines `OrderBy` (where element is key) and `Take` in a single operation. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/partial-sort.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=PartialSort 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_PartialSort.htm 20 | -------------------------------------------------------------------------------- /m/random.md: -------------------------------------------------------------------------------- 1 | # Random 2 | 3 | Returns an infinite sequence of random integers using the standard .NET random 4 | number generator. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/random.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=Random 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Random.htm 21 | -------------------------------------------------------------------------------- /m/random-double.md: -------------------------------------------------------------------------------- 1 | # RandomDouble 2 | 3 | Returns an infinite sequence of random double values between 0.0 and 1.0. 4 | 5 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 6 | // TODO add example 7 | ``` 8 | 9 | For more details, [see the documentation][doc]. 10 | 11 | --- 12 | 13 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 14 | improvement. Alternatively, you can also [report an issue you see][issue]. 15 | 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/random-double.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=RandomDouble 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_RandomDouble.htm 20 | -------------------------------------------------------------------------------- /m/rank-by.md: -------------------------------------------------------------------------------- 1 | # RankBy 2 | 3 | Ranks each item in the sequence in descending ordering by a specified key 4 | using a default comparer. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/rank-by.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=RankBy 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_RankBy.htm 21 | -------------------------------------------------------------------------------- /m/at-most.md: -------------------------------------------------------------------------------- 1 | # AtMost 2 | 3 | Determines whether or not the number of elements in the sequence is lesser 4 | than or equal to the given integer. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/at-most.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=AtMost 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_AtMost__1.htm 21 | -------------------------------------------------------------------------------- /m/partition.md: -------------------------------------------------------------------------------- 1 | # Partition 2 | 3 | Partitions a sequence by a predicate, or a grouping by Boolean keys or up to 3 4 | sets of keys. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/partition.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=Partition 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Partition.htm 21 | -------------------------------------------------------------------------------- /m/segment.md: -------------------------------------------------------------------------------- 1 | # Segment 2 | 3 | Divides a sequence into multiple sequences by using a segment detector based 4 | on the original sequence. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/segment.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=Segment 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Segment.htm 21 | -------------------------------------------------------------------------------- /m/order-by.md: -------------------------------------------------------------------------------- 1 | # OrderBy 2 | 3 | Sorts the elements of a sequence in a particular direction (ascending, 4 | descending) according to a key. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/order-by.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=OrderBy 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_OrderBy.htm 21 | -------------------------------------------------------------------------------- /m/permutations.md: -------------------------------------------------------------------------------- 1 | # Permutations 2 | 3 | Generates a sequence of lists that represent the permutations of the original 4 | sequence 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/permutations.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=Permutations 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Permutations__1.htm 21 | -------------------------------------------------------------------------------- /m/subsets.md: -------------------------------------------------------------------------------- 1 | # Subsets 2 | 3 | Returns a sequence of representing all of the subsets of any size that are 4 | part of the original sequence. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/subsets.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=Subsets 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Subsets.htm 21 | -------------------------------------------------------------------------------- /m/at-least.md: -------------------------------------------------------------------------------- 1 | # AtLeast 2 | 3 | Determines whether or not the number of elements in the sequence is greater 4 | than or equal to the given integer. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/at-least.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=AtLeast 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_AtLeast__1.htm 21 | -------------------------------------------------------------------------------- /m/from.md: -------------------------------------------------------------------------------- 1 | # From 2 | 3 | Returns a sequence containing the values resulting from invoking (in order) 4 | each function in the source sequence of functions. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/from.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=From 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_From.htm 21 | -------------------------------------------------------------------------------- /m/random-subset.md: -------------------------------------------------------------------------------- 1 | # RandomSubset 2 | 3 | Returns a sequence of a specified size of random elements from the original 4 | sequence. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/random-subset.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=RandomSubset 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_RandomSubset.htm 21 | -------------------------------------------------------------------------------- /m/starts-with.md: -------------------------------------------------------------------------------- 1 | # StartsWith 2 | 3 | Determines whether the beginning of the first sequence is equivalent to the 4 | second sequence. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/starts-with.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=StartsWith 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_StartsWith.htm 21 | -------------------------------------------------------------------------------- /m/consume.md: -------------------------------------------------------------------------------- 1 | # Consume 2 | 3 | Completely consumes the given sequence. This method uses immediate execution, 4 | and doesn't store any data during execution 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/consume.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=Consume 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Consume__1.htm 21 | -------------------------------------------------------------------------------- /m/pad-start.md: -------------------------------------------------------------------------------- 1 | # PadStart 2 | 3 | Pads a sequence with default values in the beginning if it is narrower 4 | (shorter in length) than a given width. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/pad-start.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=PadStart 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_PadStart.htm 21 | -------------------------------------------------------------------------------- /m/group-adjacent.md: -------------------------------------------------------------------------------- 1 | # GroupAdjacent 2 | 3 | Groups the adjacent elements of a sequence according to a specified key 4 | selector function. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/group-adjacent.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=GroupAdjacent 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_GroupAdjacent.htm 21 | -------------------------------------------------------------------------------- /m/then-by.md: -------------------------------------------------------------------------------- 1 | # ThenBy 2 | 3 | Performs a subsequent ordering of elements in a sequence in a particular 4 | direction (ascending, descending) according to a key. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/then-by.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=ThenBy 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_ThenBy.htm 21 | -------------------------------------------------------------------------------- /m/await.md: -------------------------------------------------------------------------------- 1 | # Await 2 | 3 | Creates a sequence query that streams the result of each task in the source 4 | sequence as it completes asynchronously. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/await.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=Await 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_Experimental_ExperimentalEnumerable_Await.htm 21 | -------------------------------------------------------------------------------- /m/except-by.md: -------------------------------------------------------------------------------- 1 | # ExceptBy 2 | 3 | Returns the set of elements in the first sequence which aren't in the second 4 | sequence, according to a given key selector. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/except-by.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=ExceptBy 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_ExceptBy.htm 21 | -------------------------------------------------------------------------------- /m/interleave.md: -------------------------------------------------------------------------------- 1 | # Interleave 2 | 3 | Interleaves the elements of two or more sequences into a single sequence, 4 | skipping sequences as they are consumed. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/interleave.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=Interleave 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Interleave__1.htm 21 | -------------------------------------------------------------------------------- /m/fallback-if-empty.md: -------------------------------------------------------------------------------- 1 | # FallbackIfEmpty 2 | 3 | Returns the elements of a sequence and falls back to another if the original 4 | sequence is empty. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/fallback-if-empty.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=FallbackIfEmpty 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_FallbackIfEmpty.htm 21 | -------------------------------------------------------------------------------- /m/count-between.md: -------------------------------------------------------------------------------- 1 | # CountBetween 2 | 3 | Determines whether or not the number of elements in the sequence is between an 4 | inclusive range of minimum and maximum integers. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/count-between.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=CountBetween 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_CountBetween__1.htm 21 | -------------------------------------------------------------------------------- /m/skip-until.md: -------------------------------------------------------------------------------- 1 | # SkipUntil 2 | 3 | Skips items from the input sequence until the given predicate returns true 4 | when applied to the current source item; that item will be the last skipped 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/skip-until.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=SkipUntil 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_SkipUntil__1.htm 21 | -------------------------------------------------------------------------------- /m/scan-right.md: -------------------------------------------------------------------------------- 1 | # ScanRight 2 | 3 | Peforms a right-associative scan (inclusive prefix) on a sequence of elements. 4 | This operator is the right-associative version of the Scan operator. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/scan-right.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=ScanRight 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_ScanRight.htm 21 | -------------------------------------------------------------------------------- /m/sorted-merge.md: -------------------------------------------------------------------------------- 1 | # SortedMerge 2 | 3 | Merges two or more sequences that are in a common order (either ascending or 4 | descending) into a single sequence that preserves that order. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/sorted-merge.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=SortedMerge 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_SortedMerge.htm 21 | -------------------------------------------------------------------------------- /m/take-until.md: -------------------------------------------------------------------------------- 1 | # TakeUntil 2 | 3 | Returns items from the input sequence until the given predicate returns true 4 | when applied to the current source item; that item will be the last returned 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/take-until.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=TakeUntil 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_TakeUntil__1.htm 21 | -------------------------------------------------------------------------------- /m/cartesian.md: -------------------------------------------------------------------------------- 1 | # Cartesian 2 | 3 | Returns the Cartesian product of two or more sequences by combining each 4 | element from the sequences and applying a user-defined projection to the 5 | set. 6 | 7 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 8 | // TODO add example 9 | ``` 10 | 11 | For more details, [see the documentation][doc]. 12 | 13 | --- 14 | 15 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 16 | improvement. Alternatively, you can also [report an issue you see][issue]. 17 | 18 | 19 | [edit]: https://github.com/morelinq/try/edit/master/m/cartesian.md 20 | [issue]: https://github.com/morelinq/try/issues/new?title=Cartesian 21 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_Cartesian.htm 22 | -------------------------------------------------------------------------------- /m/count-by.md: -------------------------------------------------------------------------------- 1 | # CountBy 2 | 3 | Applies a key-generating function to each element of a sequence and returns a 4 | sequence of unique keys and their number of occurrences in the original 5 | sequence. 6 | 7 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 8 | // TODO add example 9 | ``` 10 | 11 | For more details, [see the documentation][doc]. 12 | 13 | --- 14 | 15 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 16 | improvement. Alternatively, you can also [report an issue you see][issue]. 17 | 18 | 19 | [edit]: https://github.com/morelinq/try/edit/master/m/count-by.md 20 | [issue]: https://github.com/morelinq/try/issues/new?title=CountBy 21 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_CountBy.htm 22 | -------------------------------------------------------------------------------- /m/fill-backward.md: -------------------------------------------------------------------------------- 1 | # FillBackward 2 | 3 | Returns a sequence with each null reference or value in the source replaced 4 | with the following non-null reference or value in that sequence. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/fill-backward.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=FillBackward 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_FillBackward.htm 21 | -------------------------------------------------------------------------------- /m/fill-forward.md: -------------------------------------------------------------------------------- 1 | # FillForward 2 | 3 | Returns a sequence with each null reference or value in the source replaced 4 | with the previous non-null reference or value seen in that sequence. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/fill-forward.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=FillForward 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_FillForward.htm 21 | -------------------------------------------------------------------------------- /m/compare-count.md: -------------------------------------------------------------------------------- 1 | # CompareCount 2 | 3 | Compares two sequences and returns an integer that indicates whether the 4 | first sequence has fewer, the same or more elements than the second sequence. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/compare-count.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=CompareCount 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_CompareCount__2.htm 21 | -------------------------------------------------------------------------------- /m/to-array-by-index.md: -------------------------------------------------------------------------------- 1 | # ToArrayByIndex 2 | 3 | Creates an array from an IEnumerable where a function is used to determine 4 | the index at which an element will be placed in the array. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/to-array-by-index.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=ToArrayByIndex 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_ToArrayByIndex.htm 21 | -------------------------------------------------------------------------------- /m/distinct-by.md: -------------------------------------------------------------------------------- 1 | # DistinctBy 2 | 3 | Returns all distinct elements of the given source, where "distinctness" is 4 | determined via a projection and the default equality comparer for the 5 | projected type. 6 | 7 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 8 | // TODO add example 9 | ``` 10 | 11 | For more details, [see the documentation][doc]. 12 | 13 | --- 14 | 15 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 16 | improvement. Alternatively, you can also [report an issue you see][issue]. 17 | 18 | 19 | [edit]: https://github.com/morelinq/try/edit/master/m/distinct-by.md 20 | [issue]: https://github.com/morelinq/try/issues/new?title=DistinctBy 21 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_DistinctBy.htm 22 | -------------------------------------------------------------------------------- /m/to-delimited-string.md: -------------------------------------------------------------------------------- 1 | # ToDelimitedString 2 | 3 | Creates a delimited string from a sequence of values. The delimiter used 4 | depends on the current culture of the executing thread. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/to-delimited-string.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=ToDelimitedString 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_ToDelimitedString.htm 21 | -------------------------------------------------------------------------------- /m/ordered-merge.md: -------------------------------------------------------------------------------- 1 | # OrderedMerge 2 | 3 | Merges two ordered sequences into one. Where the elements equal in both 4 | sequences, the element from the first sequence is returned in the resulting 5 | sequence. 6 | 7 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 8 | // TODO add example 9 | ``` 10 | 11 | For more details, [see the documentation][doc]. 12 | 13 | --- 14 | 15 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 16 | improvement. Alternatively, you can also [report an issue you see][issue]. 17 | 18 | 19 | [edit]: https://github.com/morelinq/try/edit/master/m/ordered-merge.md 20 | [issue]: https://github.com/morelinq/try/issues/new?title=OrderedMerge 21 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_OrderedMerge.htm 22 | -------------------------------------------------------------------------------- /m/window-left.md: -------------------------------------------------------------------------------- 1 | # WindowLeft 2 | 3 | Creates a left-aligned sliding window over the source sequence of a given size. 4 | 5 | ```c# --destination-file ../code/Program.cs --region expression --project ../code/TryMoreLinq.csproj 6 | from w in Enumerable.Range(1, 5) 7 | .WindowLeft(3) 8 | select $"AVG({string.Join(",", w)}) = {w.Average()}" 9 | ``` 10 | 11 | For more details, [see the documentation][doc]. 12 | 13 | --- 14 | 15 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 16 | improvement. Alternatively, you can also [report an issue you see][issue]. 17 | 18 | 19 | [edit]: https://github.com/morelinq/try/edit/master/m/window-left.md 20 | [issue]: https://github.com/morelinq/try/issues/new?title=WindowLeft 21 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_WindowLeft__1.htm 22 | -------------------------------------------------------------------------------- /m/traverse-depth-first.md: -------------------------------------------------------------------------------- 1 | # TraverseDepthFirst 2 | 3 | Traverses a tree in a depth-first fashion, starting at a root node and using a 4 | user-defined function to get the children at each node of the tree. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/traverse-depth-first.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=TraverseDepthFirst 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_TraverseDepthFirst__1.htm 21 | -------------------------------------------------------------------------------- /m/unfold.md: -------------------------------------------------------------------------------- 1 | # Unfold 2 | 3 | Returns a sequence generated by applying a state to the generator function, 4 | and from its result, determines if the sequence should have a next element and 5 | its value, and the next state in the recursive call. 6 | 7 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 8 | // TODO add example 9 | ``` 10 | 11 | For more details, [see the documentation][doc]. 12 | 13 | --- 14 | 15 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 16 | improvement. Alternatively, you can also [report an issue you see][issue]. 17 | 18 | 19 | [edit]: https://github.com/morelinq/try/edit/master/m/unfold.md 20 | [issue]: https://github.com/morelinq/try/issues/new?title=Unfold 21 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Unfold__3.htm 22 | -------------------------------------------------------------------------------- /m/to-hash-set.md: -------------------------------------------------------------------------------- 1 | # ToHashSet 2 | 3 | Returns a [hash-set] of the source items using the default equality comparer 4 | for the type. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/to-hash-set.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=ToHashSet 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_ToHashSet.htm 21 | 22 | [hash-set]: https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.hashset-1 23 | -------------------------------------------------------------------------------- /m/window-right.md: -------------------------------------------------------------------------------- 1 | # WindowRight 2 | 3 | Creates a right-aligned sliding window over the source sequence of a given size. 4 | 5 | ```c# --destination-file ../code/Program.cs --region expression --project ../code/TryMoreLinq.csproj 6 | from w in Enumerable.Range(1, 5) 7 | .WindowRight(3) 8 | select $"AVG({string.Join(",", w)}) = {w.Average()}" 9 | ``` 10 | 11 | For more details, [see the documentation][doc]. 12 | 13 | --- 14 | 15 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 16 | improvement. Alternatively, you can also [report an issue you see][issue]. 17 | 18 | 19 | [edit]: https://github.com/morelinq/try/edit/master/m/window-right.md 20 | [issue]: https://github.com/morelinq/try/issues/new?title=WindowRight 21 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_WindowRight__1.htm 22 | -------------------------------------------------------------------------------- /m/run-length-encode.md: -------------------------------------------------------------------------------- 1 | # RunLengthEncode 2 | 3 | Run-length encodes a sequence by converting consecutive instances of the same 4 | element into a `KeyValuePair` representing the item and its occurrence 5 | count. 6 | 7 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 8 | // TODO add example 9 | ``` 10 | 11 | For more details, [see the documentation][doc]. 12 | 13 | --- 14 | 15 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 16 | improvement. Alternatively, you can also [report an issue you see][issue]. 17 | 18 | 19 | [edit]: https://github.com/morelinq/try/edit/master/m/run-length-encode.md 20 | [issue]: https://github.com/morelinq/try/issues/new?title=RunLengthEncode 21 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_RunLengthEncode.htm 22 | -------------------------------------------------------------------------------- /m/traverse-breadth-first.md: -------------------------------------------------------------------------------- 1 | # TraverseBreadthFirst 2 | 3 | Traverses a tree in a breadth-first fashion, starting at a root node and using 4 | a user-defined function to get the children at each node of the tree. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/traverse-breadth-first.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=TraverseBreadthFirst 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_TraverseBreadthFirst__1.htm 21 | -------------------------------------------------------------------------------- /m/pairwise.md: -------------------------------------------------------------------------------- 1 | # Pairwise 2 | 3 | Returns a sequence resulting from applying a function to each element in the 4 | source sequence and its predecessor, with the exception of the first element 5 | which is only returned as the predecessor of the second element 6 | 7 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 8 | // TODO add example 9 | ``` 10 | 11 | For more details, [see the documentation][doc]. 12 | 13 | --- 14 | 15 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 16 | improvement. Alternatively, you can also [report an issue you see][issue]. 17 | 18 | 19 | [edit]: https://github.com/morelinq/try/edit/master/m/pairwise.md 20 | [issue]: https://github.com/morelinq/try/issues/new?title=Pairwise 21 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Pairwise__2.htm 22 | -------------------------------------------------------------------------------- /m/tag-first-last.md: -------------------------------------------------------------------------------- 1 | # TagFirstLast 2 | 3 | Returns a sequence resulting from applying a function to each element in the 4 | source sequence with additional parameters indicating whether the element is 5 | the first and/or last of the sequence 6 | 7 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 8 | // TODO add example 9 | ``` 10 | 11 | For more details, [see the documentation][doc]. 12 | 13 | --- 14 | 15 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 16 | improvement. Alternatively, you can also [report an issue you see][issue]. 17 | 18 | 19 | [edit]: https://github.com/morelinq/try/edit/master/m/tag-first-last.md 20 | [issue]: https://github.com/morelinq/try/issues/new?title=TagFirstLast 21 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_TagFirstLast__2.htm 22 | -------------------------------------------------------------------------------- /m/to-data-table.md: -------------------------------------------------------------------------------- 1 | # ToDataTable 2 | 3 | Appends elements in the sequence as rows of a given object with a set of 4 | lambda expressions specifying which members (property or field) of each 5 | element in the sequence will supply the column values. 6 | 7 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 8 | // TODO add example 9 | ``` 10 | 11 | For more details, [see the documentation][doc]. 12 | 13 | --- 14 | 15 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 16 | improvement. Alternatively, you can also [report an issue you see][issue]. 17 | 18 | 19 | [edit]: https://github.com/morelinq/try/edit/master/m/to-data-table.md 20 | [issue]: https://github.com/morelinq/try/issues/new?title=ToDataTable 21 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_ToDataTable.htm 22 | -------------------------------------------------------------------------------- /m/count-down.md: -------------------------------------------------------------------------------- 1 | # CountDown 2 | 3 | Provides a countdown counter for a given count of elements at the tail of the 4 | sequence where zero always represents the last element, one represents the 5 | second-last element, two represents the third-last element and so on. 6 | 7 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 8 | // TODO add example 9 | ``` 10 | 11 | For more details, [see the documentation][doc]. 12 | 13 | --- 14 | 15 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 16 | improvement. Alternatively, you can also [report an issue you see][issue]. 17 | 18 | 19 | [edit]: https://github.com/morelinq/try/edit/master/m/count-down.md 20 | [issue]: https://github.com/morelinq/try/issues/new?title=CountDown 21 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_CountDown__2.htm 22 | -------------------------------------------------------------------------------- /m/memoize.md: -------------------------------------------------------------------------------- 1 | # Memoize 2 | 3 | Creates a sequence that lazily caches the source as it is iterated for the 4 | first time, reusing the cache thereafter for future re-iterations. If the 5 | source is already cached or buffered then it is returned verbatim. 6 | 7 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 8 | // TODO add example 9 | ``` 10 | 11 | For more details, [see the documentation][doc]. 12 | 13 | --- 14 | 15 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 16 | improvement. Alternatively, you can also [report an issue you see][issue]. 17 | 18 | 19 | [edit]: https://github.com/morelinq/try/edit/master/m/memoize.md 20 | [issue]: https://github.com/morelinq/try/issues/new?title=Memoize 21 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_Experimental_ExperimentalEnumerable_Memoize__1.htm 22 | -------------------------------------------------------------------------------- /m/backsert.md: -------------------------------------------------------------------------------- 1 | # Backsert 2 | 3 | Inserts the elements of a sequence into another sequence at a 4 | specified index from the tail of the sequence, where zero always represents 5 | the last position, one represents the second-last element, two represents 6 | the third-last element and so on. 7 | 8 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 9 | // TODO add example 10 | ``` 11 | 12 | For more details, [see the documentation][doc]. 13 | 14 | --- 15 | 16 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 17 | improvement. Alternatively, you can also [report an issue you see][issue]. 18 | 19 | 20 | [edit]: https://github.com/morelinq/try/edit/master/m/backsert.md 21 | [issue]: https://github.com/morelinq/try/issues/new?title=Backsert 22 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Backsert__1.htm 23 | -------------------------------------------------------------------------------- /m/to-lookup.md: -------------------------------------------------------------------------------- 1 | # ToLookup 2 | 3 | Creates a [lookup] from a sequence of [key-value pair][kvp] elements or tuples 4 | of 2. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | [edit]: https://github.com/morelinq/try/edit/master/m/to-lookup.md 18 | [issue]: https://github.com/morelinq/try/issues/new?title=ToLookup 19 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_ToLookup.htm 20 | 21 | [lookup]: https://docs.microsoft.com/en-us/dotnet/api/system.linq.lookup-2 22 | [kvp]: https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.KeyValuePair-2 23 | -------------------------------------------------------------------------------- /m/await-completion.md: -------------------------------------------------------------------------------- 1 | # AwaitCompletion 2 | 3 | Awaits completion of all asynchronous evaluations irrespective of whether they 4 | succeed or fail. An additional argument specifies a function that projects the 5 | final result given the source item and completed task. 6 | 7 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 8 | // TODO add example 9 | ``` 10 | 11 | For more details, [see the documentation][doc]. 12 | 13 | --- 14 | 15 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 16 | improvement. Alternatively, you can also [report an issue you see][issue]. 17 | 18 | 19 | [edit]: https://github.com/morelinq/try/edit/master/m/await-completion.md 20 | [issue]: https://github.com/morelinq/try/issues/new?title=AwaitCompletion 21 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_Experimental_ExperimentalEnumerable_AwaitCompletion__3.htm 22 | -------------------------------------------------------------------------------- /m/choose.md: -------------------------------------------------------------------------------- 1 | # Choose 2 | 3 | Applies a function to each element of the source sequence and returns a new 4 | sequence of result elements for source elements where the function returns a 5 | couple (2-tuple) having a `true` as its first element and result as the 6 | second. 7 | 8 | ```c# --destination-file ../code/Program.cs --region expression --project ../code/TryMoreLinq.csproj 9 | "O,l,2,3,4,S,6,7,B,9" 10 | .Split(',') 11 | .Choose(s => (int.TryParse(s, out var n), n)) 12 | ``` 13 | 14 | For more details, [see the documentation][doc]. 15 | 16 | --- 17 | 18 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 19 | improvement. Alternatively, you can also [report an issue you see][issue]. 20 | 21 | 22 | [edit]: https://github.com/morelinq/try/edit/master/m/choose.md 23 | [issue]: https://github.com/morelinq/try/issues/new?title=Choose 24 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Choose__2.htm 25 | -------------------------------------------------------------------------------- /m/to-dictionary.md: -------------------------------------------------------------------------------- 1 | # ToDictionary 2 | 3 | Creates a [dictionary] from a sequence of [key-value pair][kvp] elements or 4 | tuples of 2. 5 | 6 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 7 | // TODO add example 8 | ``` 9 | 10 | For more details, [see the documentation][doc]. 11 | 12 | --- 13 | 14 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 15 | improvement. Alternatively, you can also [report an issue you see][issue]. 16 | 17 | 18 | [edit]: https://github.com/morelinq/try/edit/master/m/to-dictionary.md 19 | [issue]: https://github.com/morelinq/try/issues/new?title=ToDictionary 20 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_ToDictionary.htm 21 | 22 | [dictionary]: https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.Dictionary-2 23 | [kvp]: https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.KeyValuePair-2 24 | -------------------------------------------------------------------------------- /code/Console.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using MoreLinq; 3 | 4 | namespace TryMoreLinq 5 | { 6 | // TODO Consider using CSharpObjectFormatter? 7 | // https://github.com/dotnet/roslyn/blob/Visual-Studio-2019-Version-16.1/src/Scripting/CSharp/Hosting/ObjectFormatter/CSharpObjectFormatter.cs 8 | 9 | static class Console 10 | { 11 | public static void WriteLine() => 12 | System.Console.WriteLine(); 13 | 14 | public static void WriteLine(string str) => 15 | System.Console.WriteLine(str); 16 | 17 | public static void WriteLine(object obj) => 18 | System.Console.WriteLine(obj); 19 | 20 | public static void WriteLine(IEnumerable source) 21 | { 22 | const int limit = 250; 23 | var i = 0; 24 | foreach (var item in source) 25 | { 26 | if (i + 1 > limit) 27 | { 28 | WriteLine($"(output truncated; showing only first {limit} items)"); 29 | break; 30 | } 31 | 32 | WriteLine($"[{i}] = {item}"); 33 | i++; 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /m/equi-zip.md: -------------------------------------------------------------------------------- 1 | # EquiZip 2 | 3 | Returns a projection of tuples, where each tuple contains the N-th 4 | element from each of the argument sequences. An exception is thrown 5 | if the input sequences are of different lengths. 6 | 7 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 8 | // TODO add example 9 | ``` 10 | 11 | See also [Exploring MoreLINQ Part 1 - Zipping] by [Mark Heath] and his video 12 | that covers `EquiZip`: 13 | 14 | [![Video by Mark Heath](http://img.youtube.com/vi/LmeTMUptJPo/0.jpg)](https://youtu.be/LmeTMUptJPo "MoreLINQ 1 - EquiZip, ZipLongest ZipShortest") 15 | 16 | For more details, [see the documentation][doc]. 17 | 18 | --- 19 | 20 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 21 | improvement. Alternatively, you can also [report an issue you see][issue]. 22 | 23 | 24 | [edit]: https://github.com/morelinq/try/edit/master/m/equi-zip.md 25 | [issue]: https://github.com/morelinq/try/issues/new?title=EquiZip 26 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_EquiZip.htm 27 | [Exploring MoreLINQ Part 1 - Zipping]: https://markheath.net/post/exploring-morelinq-1-zipping 28 | [Mark Heath]: https://markheath.net/ 29 | -------------------------------------------------------------------------------- /m/aggregate-right.md: -------------------------------------------------------------------------------- 1 | # AggregateRight 2 | 3 | Applies a right-associative accumulator function over a sequence. 4 | This operator is the right-associative version of the [`Aggregate`][Aggregate] 5 | LINQ operator. 6 | 7 | ```c# --destination-file ../code/Program.cs --region expression --project ../code/TryMoreLinq.csproj 8 | Enumerable 9 | .Range(1, 5) 10 | .Select(i => i.ToString()) 11 | .AggregateRight((a, b) => string.Format("({0}/{1})", a, b)) 12 | ``` 13 | 14 | Using an overload of `AggregateRight`, you can also supply a _seed_: 15 | 16 | ```c# --destination-file ../code/Program.cs --region expression --project ../code/TryMoreLinq.csproj 17 | Enumerable 18 | .Range(1, 5) 19 | .AggregateRight("6", (a, b) => string.Format("({0}/{1})", a, b)) 20 | ``` 21 | 22 | For more details, [see the documentation][doc]. 23 | 24 | --- 25 | 26 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 27 | improvement. Alternatively, you can also [report an issue you see][issue]. 28 | 29 | 30 | [edit]: https://github.com/morelinq/try/edit/master/m/aggregate-right.md 31 | [issue]: https://github.com/morelinq/try/issues/new?title=AggregateRight 32 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_AggregateRight.htm 33 | 34 | [Aggregate]: https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.aggregate 35 | -------------------------------------------------------------------------------- /m/zip-longest.md: -------------------------------------------------------------------------------- 1 | # ZipLongest 2 | 3 | Returns a projection of tuples, where each tuple contains the N-th 4 | element from each of the argument sequences. The resulting sequence 5 | will always be as long as the longest of input sequences where the 6 | default value of each of the shorter sequence element types is used 7 | for padding. 8 | 9 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 10 | // TODO add example 11 | ``` 12 | 13 | See also [Exploring MoreLINQ Part 1 - Zipping] by [Mark Heath] and his video 14 | that covers `ZipLongest`: 15 | 16 | [![Video by Mark Heath](http://img.youtube.com/vi/LmeTMUptJPo/0.jpg)](https://youtu.be/LmeTMUptJPo "MoreLINQ 1 - EquiZip, ZipLongest ZipShortest") 17 | 18 | For more details, [see the documentation][doc]. 19 | 20 | --- 21 | 22 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 23 | improvement. Alternatively, you can also [report an issue you see][issue]. 24 | 25 | 26 | [edit]: https://github.com/morelinq/try/edit/master/m/zip-longest.md 27 | [issue]: https://github.com/morelinq/try/issues/new?title=ZipLongest 28 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_ZipLongest.htm 29 | [Exploring MoreLINQ Part 1 - Zipping]: https://markheath.net/post/exploring-morelinq-1-zipping 30 | [Mark Heath]: https://markheath.net/ 31 | -------------------------------------------------------------------------------- /m/zip-shortest.md: -------------------------------------------------------------------------------- 1 | # ZipShortest 2 | 3 | Returns a projection of tuples, where each tuple contains the N-th 4 | element from each of the argument sequences. The resulting sequence 5 | is as short as the shortest input sequence. 6 | 7 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 8 | var numbers = new[] { 1, 2, 3 }; 9 | var letters = new[] { "A", "B", "C", "D" }; 10 | var chars = new[] { 'a', 'b', 'c', 'd', 'e' }; 11 | var flags = new[] { true, false }; 12 | var zipped = numbers.ZipShortest(letters, chars, flags, (n, l, c, f) => n + l + c + f); 13 | WriteLine(zipped); 14 | ``` 15 | 16 | See also [Exploring MoreLINQ Part 1 - Zipping] by [Mark Heath] and his video 17 | that covers `ZipShortest`: 18 | 19 | [![Video by Mark Heath](http://img.youtube.com/vi/LmeTMUptJPo/0.jpg)](https://youtu.be/LmeTMUptJPo "MoreLINQ 1 - EquiZip, ZipLongest ZipShortest") 20 | 21 | For more details, [see the documentation][doc]. 22 | 23 | --- 24 | 25 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 26 | improvement. Alternatively, you can also [report an issue you see][issue]. 27 | 28 | 29 | [edit]: https://github.com/morelinq/try/edit/master/m/zip-shortest.md 30 | [issue]: https://github.com/morelinq/try/issues/new?title=ZipShortest 31 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_ZipShortest.htm 32 | [Exploring MoreLINQ Part 1 - Zipping]: https://markheath.net/post/exploring-morelinq-1-zipping 33 | [Mark Heath]: https://markheath.net/ 34 | -------------------------------------------------------------------------------- /m/ends-with.md: -------------------------------------------------------------------------------- 1 | # EndsWith 2 | 3 | Determines whether the end of the first sequence is equivalent to the second 4 | sequence. 5 | 6 | The following example checks whether the [segments] of a URL's path component 7 | end with a particular sequence or not: 8 | 9 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 10 | var tail = new[] { "foo/", "bar/" }; 11 | 12 | var url1 = new Uri("http://example.com/foo/bar/"); 13 | WriteLine(url1.Segments.EndsWith(tail)); // True 14 | 15 | var url2 = new Uri("http://example.com/foo/bar/baz/"); 16 | WriteLine(url2.Segments.EndsWith(tail)); // False 17 | ``` 18 | 19 | The same example as above is expressed as a single query expression below: 20 | 21 | ```c# --destination-file ../code/Program.cs --region expression --project ../code/TryMoreLinq.csproj 22 | from url in new[] 23 | { 24 | "http://example.com/foo/bar/", 25 | "http://example.com/foo/bar/baz/", 26 | } 27 | select new Uri(url) into url 28 | select new 29 | { 30 | Url = url, 31 | EndsWithFooBar = url.Segments.EndsWith(new[] { "foo/", "bar/" }), 32 | } 33 | ``` 34 | 35 | For more details, [see the documentation][doc]. 36 | 37 | --- 38 | 39 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 40 | improvement. Alternatively, you can also [report an issue you see][issue]. 41 | 42 | 43 | [edit]: https://github.com/morelinq/try/edit/master/m/ends-with.md 44 | [issue]: https://github.com/morelinq/try/issues/new?title=EndsWith 45 | [doc]: https://morelinq.github.io/3.1/ref/api/html/Overload_MoreLinq_MoreEnumerable_EndsWith.htm 46 | [segments]: https://docs.microsoft.com/en-us/dotnet/api/system.uri.segments 47 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org/ 2 | 3 | root = true 4 | 5 | [*] 6 | indent_style = space 7 | insert_final_newline = true 8 | trim_trailing_whitespace = true 9 | 10 | [*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] 11 | indent_size = 2 12 | 13 | [*.{sln}] 14 | indent_style = tab 15 | 16 | [*.{json,yml}] 17 | indent_size = 2 18 | 19 | [*.{cs,tt}] 20 | charset = utf-8 21 | indent_style = space 22 | indent_size = 4 23 | max_line_length = 100 24 | 25 | [*.cs] 26 | # Prefer "var" everywhere 27 | csharp_style_var_for_built_in_types = true:suggestion 28 | csharp_style_var_when_type_is_apparent = true:suggestion 29 | csharp_style_var_elsewhere = true:suggestion 30 | 31 | # Prefer method-like constructs to have a block body 32 | csharp_style_expression_bodied_methods = false:none 33 | csharp_style_expression_bodied_constructors = false:none 34 | csharp_style_expression_bodied_operators = false:none 35 | 36 | # Prefer property-like constructs to have an expression-body 37 | csharp_style_expression_bodied_properties = true:none 38 | csharp_style_expression_bodied_indexers = true:none 39 | csharp_style_expression_bodied_accessors = true:none 40 | 41 | # Suggest more modern language features when available 42 | csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion 43 | csharp_style_pattern_matching_over_as_with_null_check = true:suggestion 44 | csharp_style_inlined_variable_declaration = true:suggestion 45 | csharp_style_throw_expression = true:suggestion 46 | csharp_style_conditional_delegate_call = true:suggestion 47 | csharp_prefer_simple_default_expression = true:suggestion 48 | 49 | # Spacing 50 | csharp_space_after_cast = false 51 | csharp_space_after_keywords_in_control_flow_statements = true 52 | csharp_space_between_method_declaration_parameter_list_parentheses = false 53 | 54 | # Wrapping 55 | csharp_preserve_single_line_statements = true 56 | csharp_preserve_single_line_blocks = true 57 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guidelines 2 | 3 | You can help by contributing new examples or improve on existing ones that 4 | demonstrate how to use the various MoreLINQ methods and extensions. 5 | 6 | All it takes to add an example is the following fenced-block in a Markdown 7 | document: 8 | 9 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 10 | // replace this comment with your example code 11 | ``` 12 | 13 | **You can develop an example as a single C# expression or as C# statements.** 14 | In the above example, `--region statements` assumes the example code is 15 | expressed as one or more C# statements: 16 | 17 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 18 | var xs = Enumerable.Range(1, 5); 19 | foreach (var x in xs) 20 | Console.WriteLine(x); 21 | ``` 22 | 23 | To show an example as a single C# expression, instead, change 24 | `--region statements` to `--region expression`. The benefit is that you do not 25 | need to worry about looping and displaying the result of the expression via 26 | `Console.WriteLine`. This will be done automatically when the example is run 27 | interactively through Try .NET. Following is an example using an expression: 28 | 29 | ```c# --destination-file ../code/Program.cs --region expression --project ../code/TryMoreLinq.csproj 30 | Enumerable.Range(1, 5) 31 | ``` 32 | 33 | Note that expressions _must not_ be terminated by a semi-colon (`;`), which is 34 | the standard syntax rule in C#. 35 | 36 | Keep examples: 37 | 38 | - simple 39 | - clear 40 | - short 41 | - meaningful 42 | - self-contained 43 | 44 | You may use C# 8 in example code. 45 | 46 | **Wrap paragraphs in Markdown documents such that no line exceeds 78 47 | characters in length.** See the "Wrap Your Text" section of [Markdown Style 48 | Guide] on [Miguel de Icaza's Blog][tirania] for the background behind this 49 | choice. 50 | 51 | That's it! Fork away and submit your pull request! 52 | 53 | 54 | [Markdown Style Guide]: https://tirania.org/blog/archive/2014/Sep-30.html 55 | [tirania]: https://tirania.org/blog/ 56 | -------------------------------------------------------------------------------- /setup.md: -------------------------------------------------------------------------------- 1 | # Setup 2 | 3 | Example code is written directly into Markdown documents, which requires 4 | nothing more than a text editor. However, to develop, run and test those 5 | examples interactively and ensure their correctness, you will need 6 | [Try .NET][dotnet-try] installed as a global tool using: 7 | 8 | dotnet tool install -g dotnet-try --version 1.0.19266.1 9 | 10 | Once installed, simply run `dotnet try` in a directory with a clone of the 11 | repository containing this documentation. 12 | 13 | Try .NET requires [.NET Core 3.0 SDK][netcore3] _and_ [2.1][netcore21] to be 14 | installed prior to its installation and use. 15 | 16 | If you have [Docker] installed, you can get Try .NET and its requirements 17 | setup in a ready-to-run container image without affecting your local setup. 18 | To do so, create a file named `Dockerfile` with the following content: 19 | 20 | ```Dockerfile 21 | FROM microsoft/dotnet:3.0-sdk 22 | 23 | ENV PATH="${PATH}:/root/.dotnet/tools" 24 | 25 | RUN dotnet tool install -g dotnet-try --version 1.0.19266.1 \ 26 | && curl -sSL https://dot.net/v1/dotnet-install.sh \ 27 | | bash /dev/stdin --install-dir /usr/share/dotnet --version 2.1.503 \ 28 | && mkdir /doc 29 | 30 | WORKDIR /doc 31 | 32 | ENTRYPOINT ["dotnet", "try"] 33 | ``` 34 | 35 | Next, build the image, tagging it `dotnet-try`: 36 | 37 | docker build -t dotnet-try . 38 | 39 | Then whenever you wish to develop, run and test the code in the Markdown 40 | documents, change the current working directory of your shell (`cd`) to where 41 | you cloned the repository containing the documents and run the image using: 42 | 43 | docker run -ti --rm -p 5000:80 -v "$(pwd):/doc" dotnet-try 44 | 45 | If you are using PowerShell, run instead using: 46 | 47 | docker run -ti --rm -p 5000:80 -v "$($PWD)/doc" dotnet-try 48 | 49 | If you are using the Windows Command Prompt (`cmd.exe`), run instead 50 | using: 51 | 52 | docker run -ti --rm -p 5000:80 -v "%cd%/doc" dotnet-try 53 | 54 | Finally, open a browser and navigate to `http://localhost:5000/README.md`. 55 | 56 | 57 | [dotnet-try]: https://github.com/dotnet/try 58 | [dotnet-try-setup]: https://github.com/dotnet/try/blob/301dacfdd8af34586def0722a08452bab6393bc9/README.md#setup 59 | [netcore21]: https://dotnet.microsoft.com/download/dotnet-core/2.1 60 | [netcore3]: https://dotnet.microsoft.com/download/dotnet-core/3.0 61 | [docker]: https://www.docker.com/ 62 | -------------------------------------------------------------------------------- /m/aggregate.md: -------------------------------------------------------------------------------- 1 | # Aggregate 2 | 3 | Applies multiple accumulators sequentially in a single pass over a sequence. 4 | 5 | In the example below, `Aggregate` is used to run the following seven 6 | accumulators: 7 | 8 | - sum of all numbers 9 | - sum of even numbers 10 | - count of numbers 11 | - smallest number 12 | - largest number 13 | - distinct number of digits across all numbers 14 | - list of numbers 15 | 16 | concurrently, and in a single pass, over a sequence of integers: 17 | 18 | ```c# --destination-file ../code/Program.cs --region expression --project ../code/TryMoreLinq.csproj 19 | Enumerable 20 | .Range(1, 10) 21 | .Shuffle() 22 | .Select(n => new { Num = n, Str = n.ToString(CultureInfo.InvariantCulture) }) 23 | .Aggregate( 24 | 0, (s, e) => s + e.Num, 25 | 0, (s, e) => e.Num % 2 == 0 ? s + e.Num : s, 26 | 0, (s, _) => s + 1, 27 | (int?)null, (s, e) => s is int n ? Math.Min(n, e.Num) : e.Num, 28 | (int?)null, (s, e) => s is int n ? Math.Max(n, e.Num) : e.Num, 29 | new HashSet(), (s, e) => { s.Add(e.Str.Length); return s; }, 30 | new List<(int, string)>(), (s, e) => { s.Add((e.Num, e.Str)); return s; }, 31 | (sum, esum, count, min, max, lengths, items) => new 32 | { 33 | Sum = sum, 34 | EvenSum = esum, 35 | Count = count, 36 | Average = (double)sum / count, 37 | Min = min is int mn ? mn : throw new InvalidOperationException(), 38 | Max = max is int mx ? mx : throw new InvalidOperationException(), 39 | UniqueLengths = "[" + string.Join(", ", lengths) + "]", 40 | Items = "[" + string.Join(", ", items) + "]", 41 | }) 42 | ``` 43 | 44 | Writing each aggregator this way can be tedious, repetitive and error-prone 45 | because you cannot, for example, reuse [`Enumerable.Sum`][sum] but there is 46 | a set of [_experimental overloads_][exp] (that live in the 47 | [`MoreLinq.Experimental` namespace][expns]) that allow aggregators to be written 48 | as _reactive comprehensions_. This enables you to use aggregators from 49 | [System.Reactive]. The next example is logically the same as the previous, 50 | except it uses the overload where aggregators from System.Reactive are reused. 51 | 52 | ```c# --destination-file ../code/Program.cs --region expression --project ../code/TryMoreLinq.csproj 53 | Enumerable 54 | .Range(1, 10) 55 | .Shuffle() 56 | .Select(n => new { Num = n, Str = n.ToString(CultureInfo.InvariantCulture) }) 57 | .Aggregate( 58 | s => s.Sum(e => e.Num), 59 | s => s.Select(e => e.Num).Where(n => n % 2 == 0).Sum(), 60 | s => s.Count(), 61 | s => s.Min(e => e.Num), 62 | s => s.Max(e => e.Num), 63 | s => s.Select(e => e.Str.Length).Distinct().ToArray(), 64 | s => s.ToList(), 65 | (sum, esum, count, min, max, lengths, items) => new 66 | { 67 | Sum = sum, 68 | EvenSum = esum, 69 | Count = count, 70 | Average = (double)sum / count, 71 | Min = min, 72 | Max = max, 73 | UniqueLengths = "[" + string.Join(", ", lengths) + "]", 74 | Items = "[" + string.Join(", ", items) + "]", 75 | }) 76 | ``` 77 | 78 | For more details, [see the documentation][doc]. 79 | 80 | --- 81 | 82 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 83 | improvement. Alternatively, you can also [report an issue you see][issue]. 84 | 85 | 86 | [edit]: https://github.com/morelinq/try/edit/master/m/aggregate.md 87 | [issue]: https://github.com/morelinq/try/issues/new?title=Aggregate 88 | [doc]: https://morelinq.github.io/3.2/ref/api/html/Overload_MoreLinq_MoreEnumerable_Aggregate.htm 89 | 90 | [sum]: https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.sum 91 | [expns]: https://morelinq.github.io/3.2/ref/api/html/N_MoreLinq_Experimental.htm 92 | [exp]: https://morelinq.github.io/3.2/ref/api/html/Overload_MoreLinq_Experimental_ExperimentalEnumerable_Aggregate.htm 93 | [System.Reactive]: https://www.nuget.org/packages/System.Reactive/ 94 | -------------------------------------------------------------------------------- /m/acquire.md: -------------------------------------------------------------------------------- 1 | # Acquire 2 | 3 | Ensures that a sequence of _disposable_ objects, those implementing 4 | [`IDisposable`][disposable]), are all acquired successfully. If the 5 | acquisition of any one fails then those successfully acquired till that 6 | point are disposed. 7 | 8 | Following [answer][a] by [Sergey Berezovskiy][sb] to the [StackOverflow] 9 | question, "[MoreLinq Acquire. What does it do?][q]", offers a 10 | great explanation: 11 | 12 | > Assume you have code which creates and returns disposable objects one by one: 13 | > 14 | > ```c# 15 | > public IEnumerable GetFiles() 16 | > { 17 | > yield return File.OpenRead("file1"); 18 | > yield return File.OpenRead("file2"); // does not exist 19 | > yield return File.OpenRead("file3"); 20 | > } 21 | > ``` 22 | > 23 | > You need to get all of the disposable objects, but if in the middle of 24 | > acquisition there is an exception, then the objects which were already yielded 25 | > will stay in memory and not disposed. So, `Acquire` either acquires all 26 | > streams and returns them, or, upon failing, it disposes all already acquired 27 | > streams and rethrows the exception. 28 | > 29 | > ```c# 30 | > var streams = GetFiles().Acquire(); 31 | > ``` 32 | 33 | The following example shows a function lazily yielding resources (objects 34 | implementing `IDisposable`) that are later acquired and disposed in a loop. 35 | 36 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 37 | static IEnumerable GetResources() 38 | { 39 | WriteLine("Yielding resource #1"); 40 | yield return Disposable(() => WriteLine("Resource #1 disposed")); 41 | WriteLine("Yielding resource #2"); 42 | yield return Disposable(() => WriteLine("Resource #2 disposed")); 43 | WriteLine("Yielding resource #3"); 44 | yield return Disposable(() => WriteLine("Resource #3 disposed")); 45 | } 46 | 47 | var i = 0; 48 | foreach (var r in GetResources().Acquire()) 49 | { 50 | i++; 51 | using (r) 52 | WriteLine($"Disposing resource #{i}"); 53 | } 54 | ``` 55 | 56 | The `GetResources` function uses `Disposable` from the [Delegating] library to 57 | create ad-hoc implementations. Running the example will produce the output: 58 | 59 | ``` 60 | Yielding resource #1 61 | Yielding resource #2 62 | Yielding resource #3 63 | Disposing resource #1 64 | Resource #1 disposed 65 | Disposing resource #2 66 | Resource #2 disposed 67 | Disposing resource #3 68 | Resource #3 disposed 69 | ``` 70 | 71 | Note how all the resources were acquired _eagerly_ at the start of the loop. 72 | 73 | Suppose now `GetResources` is modified to simulate an error in the generation 74 | of the third resource: 75 | 76 | ```c# --destination-file ../code/Program.cs --region statements --project ../code/TryMoreLinq.csproj 77 | static IEnumerable GetResources() 78 | { 79 | WriteLine("Yielding resource #1"); 80 | yield return Disposable(() => WriteLine("Resource #1 disposed")); 81 | WriteLine("Yielding resource #2"); 82 | yield return Disposable(() => WriteLine("Resource #2 disposed")); 83 | WriteLine("Yielding resource #3"); 84 | throw new ApplicationException(); // Oops! 85 | // CS0162: Unreachable code detected 86 | yield return Disposable(() => WriteLine("Resource #3 disposed")); 87 | } 88 | 89 | try 90 | { 91 | var i = 0; 92 | foreach (var r in GetResources().Acquire()) 93 | { 94 | i++; 95 | using (r) 96 | WriteLine($"Disposing resource #{i}"); 97 | } 98 | } 99 | catch (Exception e) 100 | { 101 | WriteLine("ERROR! " + e.Message); 102 | } 103 | ``` 104 | 105 | The ouput this time will read: 106 | 107 | ``` 108 | Yielding resource #1 109 | Yielding resource #2 110 | Yielding resource #3 111 | Resource #1 disposed 112 | Resource #2 disposed 113 | ERROR! Error in the application. 114 | ``` 115 | 116 | Since not all resouces could be acquired successfully, because an error occurs 117 | when the third resource is about to be yielded, `Acquire` disposes the first 118 | two resources that were acquired successfully up to when the error occurs and 119 | propagates up the stack. Since the loop is never entered, it would not have 120 | had a chance to dispose the resources. Without `Acquire`, the resources would 121 | have leaked. 122 | 123 | For more details, [see the documentation][doc]. 124 | 125 | --- 126 | 127 | [✏ Edit this page][edit] if you see a typo or wish to contribute an 128 | improvement. Alternatively, you can also [report an issue you see][issue]. 129 | 130 | 131 | [edit]: https://github.com/morelinq/try/edit/master/m/acquire.md 132 | [issue]: https://github.com/morelinq/try/issues/new?title=Acquire 133 | [doc]: https://morelinq.github.io/3.1/ref/api/html/M_MoreLinq_MoreEnumerable_Acquire__1.htm 134 | [sb]: https://stackoverflow.com/users/470005/sergey-berezovskiy 135 | [StackOverflow]: https://stackoverflow.com/ 136 | [q]: https://stackoverflow.com/questions/21483023/morelinq-acquire-what-does-it-do 137 | [a]: https://stackoverflow.com/a/21483151/6682 138 | [disposable]: https://docs.microsoft.com/en-us/dotnet/api/system.idisposable 139 | [Delegating]: https://github.com/atifaziz/Delegating 140 | -------------------------------------------------------------------------------- /code/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Globalization; 5 | using System.Linq; 6 | using System.Reactive.Linq; 7 | using System.Reflection; 8 | using MoreLinq.Experimental; 9 | using static Delegating.Delegate; 10 | using Enumerable = System.Linq.Enumerable; 11 | using MoreEnumerable = MoreLinq.MoreEnumerable; 12 | using OrderByDirection = MoreLinq.OrderByDirection; 13 | using static MoreLinq.Extensions.AcquireExtension; 14 | using static MoreLinq.Extensions.AggregateExtension; 15 | using static MoreLinq.Extensions.AggregateRightExtension; 16 | using static MoreLinq.Extensions.AssertCountExtension; 17 | using static MoreLinq.Extensions.AssertExtension; 18 | using static MoreLinq.Extensions.AtLeastExtension; 19 | using static MoreLinq.Extensions.AtMostExtension; 20 | using static MoreLinq.Extensions.BacksertExtension; 21 | using static MoreLinq.Extensions.BatchExtension; 22 | using static MoreLinq.Extensions.CartesianExtension; 23 | using static MoreLinq.Extensions.ChooseExtension; 24 | using static MoreLinq.Extensions.CompareCountExtension; 25 | using static MoreLinq.Extensions.ConsumeExtension; 26 | using static MoreLinq.Extensions.CountBetweenExtension; 27 | using static MoreLinq.Extensions.CountByExtension; 28 | using static MoreLinq.Extensions.CountDownExtension; 29 | using static MoreLinq.Extensions.DistinctByExtension; 30 | using static MoreLinq.Extensions.EndsWithExtension; 31 | using static MoreLinq.Extensions.EquiZipExtension; 32 | using static MoreLinq.Extensions.EvaluateExtension; 33 | using static MoreLinq.Extensions.ExactlyExtension; 34 | using static MoreLinq.Extensions.ExceptByExtension; 35 | using static MoreLinq.Extensions.ExcludeExtension; 36 | using static MoreLinq.Extensions.FallbackIfEmptyExtension; 37 | using static MoreLinq.Extensions.FillBackwardExtension; 38 | using static MoreLinq.Extensions.FillForwardExtension; 39 | using static MoreLinq.Extensions.FirstExtension; 40 | using static MoreLinq.Extensions.FirstOrDefaultExtension; 41 | using static MoreLinq.Extensions.FlattenExtension; 42 | using static MoreLinq.Extensions.FoldExtension; 43 | using static MoreLinq.Extensions.ForEachExtension; 44 | using static MoreLinq.Extensions.FullGroupJoinExtension; 45 | using static MoreLinq.Extensions.FullJoinExtension; 46 | using static MoreLinq.Extensions.GroupAdjacentExtension; 47 | using static MoreLinq.Extensions.IndexExtension; 48 | using static MoreLinq.Extensions.InsertExtension; 49 | using static MoreLinq.Extensions.InterleaveExtension; 50 | using static MoreLinq.Extensions.LagExtension; 51 | using static MoreLinq.Extensions.LastExtension; 52 | using static MoreLinq.Extensions.LastOrDefaultExtension; 53 | using static MoreLinq.Extensions.LeadExtension; 54 | using static MoreLinq.Extensions.LeftJoinExtension; 55 | using static MoreLinq.Extensions.MaxByExtension; 56 | using static MoreLinq.Extensions.MinByExtension; 57 | using static MoreLinq.Extensions.MoveExtension; 58 | using static MoreLinq.Extensions.OrderByExtension; 59 | using static MoreLinq.Extensions.OrderedMergeExtension; 60 | using static MoreLinq.Extensions.PadExtension; 61 | using static MoreLinq.Extensions.PadStartExtension; 62 | using static MoreLinq.Extensions.PairwiseExtension; 63 | using static MoreLinq.Extensions.PartialSortByExtension; 64 | using static MoreLinq.Extensions.PartialSortExtension; 65 | using static MoreLinq.Extensions.PartitionExtension; 66 | using static MoreLinq.Extensions.PermutationsExtension; 67 | using static MoreLinq.Extensions.PipeExtension; 68 | using static MoreLinq.Extensions.PreScanExtension; 69 | using static MoreLinq.Extensions.RandomSubsetExtension; 70 | using static MoreLinq.Extensions.RankByExtension; 71 | using static MoreLinq.Extensions.RankExtension; 72 | using static MoreLinq.Extensions.RepeatExtension; 73 | using static MoreLinq.Extensions.RightJoinExtension; 74 | using static MoreLinq.Extensions.RunLengthEncodeExtension; 75 | using static MoreLinq.Extensions.ScanExtension; 76 | using static MoreLinq.Extensions.ScanRightExtension; 77 | using static MoreLinq.Extensions.SegmentExtension; 78 | using static MoreLinq.Extensions.ShuffleExtension; 79 | using static MoreLinq.Extensions.SingleExtension; 80 | using static MoreLinq.Extensions.SingleOrDefaultExtension; 81 | using static MoreLinq.Extensions.SkipUntilExtension; 82 | using static MoreLinq.Extensions.SliceExtension; 83 | using static MoreLinq.Extensions.SortedMergeExtension; 84 | using static MoreLinq.Extensions.SplitExtension; 85 | using static MoreLinq.Extensions.StartsWithExtension; 86 | using static MoreLinq.Extensions.SubsetsExtension; 87 | using static MoreLinq.Extensions.TagFirstLastExtension; 88 | using static MoreLinq.Extensions.TakeEveryExtension; 89 | using static MoreLinq.Extensions.TakeUntilExtension; 90 | using static MoreLinq.Extensions.ThenByExtension; 91 | using static MoreLinq.Extensions.ToArrayByIndexExtension; 92 | using static MoreLinq.Extensions.ToDataTableExtension; 93 | using static MoreLinq.Extensions.ToDelimitedStringExtension; 94 | using static MoreLinq.Extensions.ToDictionaryExtension; 95 | using static MoreLinq.Extensions.ToLookupExtension; 96 | using static MoreLinq.Extensions.TraceExtension; 97 | using static MoreLinq.Extensions.TransposeExtension; 98 | using static MoreLinq.Extensions.WindowExtension; 99 | using static MoreLinq.Extensions.WindowLeftExtension; 100 | using static MoreLinq.Extensions.WindowRightExtension; 101 | using static MoreLinq.Extensions.ZipLongestExtension; 102 | using static MoreLinq.Extensions.ZipShortestExtension; 103 | using static TryMoreLinq.Console; 104 | 105 | namespace TryMoreLinq 106 | { 107 | static partial class Program 108 | { 109 | static void Main(string[] args, string region = null) 110 | { 111 | if (region == "expression") 112 | ExpressionExample(); 113 | else 114 | StatementsExample(); 115 | } 116 | 117 | static void ExpressionExample() 118 | { 119 | WriteLine( 120 | #region expression 121 | #endregion 122 | ); 123 | } 124 | 125 | static void StatementsExample() 126 | { 127 | #region statements 128 | #endregion 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.binlog 2 | .trydotnet-* 3 | 4 | # Created by https://www.gitignore.io/api/linux,macos,windows,visualstudio,visualstudiocode 5 | 6 | ### Linux ### 7 | *~ 8 | 9 | # temporary files which can be created if a process still has a handle open of a deleted file 10 | .fuse_hidden* 11 | 12 | # KDE directory preferences 13 | .directory 14 | 15 | # Linux trash folder which might appear on any partition or disk 16 | .Trash-* 17 | 18 | # .nfs files are created when an open file is removed but is still being accessed 19 | .nfs* 20 | 21 | ### macOS ### 22 | *.DS_Store 23 | .AppleDouble 24 | .LSOverride 25 | 26 | # Icon must end with two \r 27 | Icon 28 | 29 | # Thumbnails 30 | ._* 31 | 32 | # Files that might appear in the root of a volume 33 | .DocumentRevisions-V100 34 | .fseventsd 35 | .Spotlight-V100 36 | .TemporaryItems 37 | .Trashes 38 | .VolumeIcon.icns 39 | .com.apple.timemachine.donotpresent 40 | 41 | # Directories potentially created on remote AFP share 42 | .AppleDB 43 | .AppleDesktop 44 | Network Trash Folder 45 | Temporary Items 46 | .apdisk 47 | 48 | ### VisualStudioCode ### 49 | .vscode/* 50 | !.vscode/settings.json 51 | !.vscode/tasks.json 52 | !.vscode/launch.json 53 | !.vscode/extensions.json 54 | .history 55 | 56 | ### Windows ### 57 | # Windows thumbnail cache files 58 | Thumbs.db 59 | ehthumbs.db 60 | ehthumbs_vista.db 61 | 62 | # Folder config file 63 | Desktop.ini 64 | 65 | # Recycle Bin used on file shares 66 | $RECYCLE.BIN/ 67 | 68 | # Windows Installer files 69 | *.cab 70 | *.msi 71 | *.msm 72 | *.msp 73 | 74 | # Windows shortcuts 75 | *.lnk 76 | 77 | ### VisualStudio ### 78 | ## Ignore Visual Studio temporary files, build results, and 79 | ## files generated by popular Visual Studio add-ons. 80 | ## 81 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 82 | 83 | # User-specific files 84 | *.suo 85 | *.user 86 | *.userosscache 87 | *.sln.docstates 88 | 89 | # User-specific files (MonoDevelop/Xamarin Studio) 90 | *.userprefs 91 | 92 | # Build results 93 | [Dd]ebug/ 94 | [Dd]ebugPublic/ 95 | [Rr]elease/ 96 | [Rr]eleases/ 97 | x64/ 98 | x86/ 99 | bld/ 100 | [Bb]in/ 101 | [Oo]bj/ 102 | [Ll]og/ 103 | 104 | # Visual Studio 2015 cache/options directory 105 | .vs/ 106 | # Uncomment if you have tasks that create the project's static files in wwwroot 107 | #wwwroot/ 108 | 109 | # MSTest test Results 110 | [Tt]est[Rr]esult*/ 111 | [Bb]uild[Ll]og.* 112 | 113 | # NUNIT 114 | *.VisualState.xml 115 | TestResult.xml 116 | 117 | # Build Results of an ATL Project 118 | [Dd]ebugPS/ 119 | [Rr]eleasePS/ 120 | dlldata.c 121 | 122 | # .NET Core 123 | project.lock.json 124 | project.fragment.lock.json 125 | artifacts/ 126 | **/Properties/launchSettings.json 127 | 128 | *_i.c 129 | *_p.c 130 | *_i.h 131 | *.ilk 132 | *.meta 133 | *.obj 134 | *.pch 135 | *.pdb 136 | *.pgc 137 | *.pgd 138 | *.rsp 139 | *.sbr 140 | *.tlb 141 | *.tli 142 | *.tlh 143 | *.tmp 144 | *.tmp_proj 145 | *.log 146 | *.vspscc 147 | *.vssscc 148 | .builds 149 | *.pidb 150 | *.svclog 151 | *.scc 152 | 153 | # Chutzpah Test files 154 | _Chutzpah* 155 | 156 | # Visual C++ cache files 157 | ipch/ 158 | *.aps 159 | *.ncb 160 | *.opendb 161 | *.opensdf 162 | *.sdf 163 | *.cachefile 164 | *.VC.db 165 | *.VC.VC.opendb 166 | 167 | # Visual Studio profiler 168 | *.psess 169 | *.vsp 170 | *.vspx 171 | *.sap 172 | 173 | # TFS 2012 Local Workspace 174 | $tf/ 175 | 176 | # Guidance Automation Toolkit 177 | *.gpState 178 | 179 | # ReSharper is a .NET coding add-in 180 | _ReSharper*/ 181 | *.[Rr]e[Ss]harper 182 | *.DotSettings.user 183 | 184 | # JustCode is a .NET coding add-in 185 | .JustCode 186 | 187 | # TeamCity is a build add-in 188 | _TeamCity* 189 | 190 | # DotCover is a Code Coverage Tool 191 | *.dotCover 192 | 193 | # Visual Studio code coverage results 194 | *.coverage 195 | *.coveragexml 196 | 197 | # NCrunch 198 | _NCrunch_* 199 | .*crunch*.local.xml 200 | nCrunchTemp_* 201 | 202 | # MightyMoose 203 | *.mm.* 204 | AutoTest.Net/ 205 | 206 | # Web workbench (sass) 207 | .sass-cache/ 208 | 209 | # Installshield output folder 210 | [Ee]xpress/ 211 | 212 | # DocProject is a documentation generator add-in 213 | DocProject/buildhelp/ 214 | DocProject/Help/*.HxT 215 | DocProject/Help/*.HxC 216 | DocProject/Help/*.hhc 217 | DocProject/Help/*.hhk 218 | DocProject/Help/*.hhp 219 | DocProject/Help/Html2 220 | DocProject/Help/html 221 | 222 | # Click-Once directory 223 | publish/ 224 | 225 | # Publish Web Output 226 | *.[Pp]ublish.xml 227 | *.azurePubxml 228 | # TODO: Uncomment the next line to ignore your web deploy settings. 229 | # By default, sensitive information, such as encrypted password 230 | # should be stored in the .pubxml.user file. 231 | #*.pubxml 232 | *.pubxml.user 233 | *.publishproj 234 | 235 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 236 | # checkin your Azure Web App publish settings, but sensitive information contained 237 | # in these scripts will be unencrypted 238 | PublishScripts/ 239 | 240 | # NuGet Packages 241 | *.nupkg 242 | # The packages folder can be ignored because of Package Restore 243 | **/packages/* 244 | # except build/, which is used as an MSBuild target. 245 | !**/packages/build/ 246 | # Uncomment if necessary however generally it will be regenerated when needed 247 | #!**/packages/repositories.config 248 | # NuGet v3's project.json files produces more ignorable files 249 | *.nuget.props 250 | *.nuget.targets 251 | 252 | # Microsoft Azure Build Output 253 | csx/ 254 | *.build.csdef 255 | 256 | # Microsoft Azure Emulator 257 | ecf/ 258 | rcf/ 259 | 260 | # Windows Store app package directories and files 261 | AppPackages/ 262 | BundleArtifacts/ 263 | Package.StoreAssociation.xml 264 | _pkginfo.txt 265 | 266 | # Visual Studio cache files 267 | # files ending in .cache can be ignored 268 | *.[Cc]ache 269 | # but keep track of directories ending in .cache 270 | !*.[Cc]ache/ 271 | 272 | # Others 273 | ClientBin/ 274 | ~$* 275 | *.dbmdl 276 | *.dbproj.schemaview 277 | *.jfm 278 | *.pfx 279 | *.publishsettings 280 | orleans.codegen.cs 281 | 282 | # Since there are multiple workflows, uncomment next line to ignore bower_components 283 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 284 | #bower_components/ 285 | 286 | # RIA/Silverlight projects 287 | Generated_Code/ 288 | 289 | # Backup & report files from converting an old project file 290 | # to a newer Visual Studio version. Backup files are not needed, 291 | # because we have git ;-) 292 | _UpgradeReport_Files/ 293 | Backup*/ 294 | UpgradeLog*.XML 295 | UpgradeLog*.htm 296 | 297 | # SQL Server files 298 | *.mdf 299 | *.ldf 300 | *.ndf 301 | 302 | # Business Intelligence projects 303 | *.rdl.data 304 | *.bim.layout 305 | *.bim_*.settings 306 | 307 | # Microsoft Fakes 308 | FakesAssemblies/ 309 | 310 | # GhostDoc plugin setting file 311 | *.GhostDoc.xml 312 | 313 | # Node.js Tools for Visual Studio 314 | .ntvs_analysis.dat 315 | node_modules/ 316 | 317 | # Typescript v1 declaration files 318 | typings/ 319 | 320 | # Visual Studio 6 build log 321 | *.plg 322 | 323 | # Visual Studio 6 workspace options file 324 | *.opt 325 | 326 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 327 | *.vbw 328 | 329 | # Visual Studio LightSwitch build output 330 | **/*.HTMLClient/GeneratedArtifacts 331 | **/*.DesktopClient/GeneratedArtifacts 332 | **/*.DesktopClient/ModelManifest.xml 333 | **/*.Server/GeneratedArtifacts 334 | **/*.Server/ModelManifest.xml 335 | _Pvt_Extensions 336 | 337 | # Paket dependency manager 338 | .paket/paket.exe 339 | paket-files/ 340 | 341 | # FAKE - F# Make 342 | .fake/ 343 | 344 | # JetBrains Rider 345 | .idea/ 346 | *.sln.iml 347 | 348 | # CodeRush 349 | .cr/ 350 | 351 | # Python Tools for Visual Studio (PTVS) 352 | __pycache__/ 353 | *.pyc 354 | 355 | # Cake - Uncomment if you are using it 356 | # tools/** 357 | # !tools/packages.config 358 | 359 | # Telerik's JustMock configuration file 360 | *.jmconfig 361 | 362 | # BizTalk build output 363 | *.btp.cs 364 | *.btm.cs 365 | *.odx.cs 366 | *.xsd.cs 367 | 368 | ### VisualStudio Patch ### 369 | # By default, sensitive information, such as encrypted password 370 | # should be stored in the .pubxml.user file. 371 | 372 | # End of https://www.gitignore.io/api/linux,macos,windows,visualstudio,visualstudiocode 373 | 374 | tests/coverage.* 375 | tools/ 376 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Try MoreLINQ 2 | 3 | This documentation contains examples for using [MoreLINQ]. The examples can be 4 | run and tested interactively in a browser using [`dotnet try` 5 | (Try .NET)][dotnet-try]. 6 | 7 | See [Setup](setup.md) for requirements and installation instructions. 8 | 9 | See the [Contribution Guidelines](CONTRIBUTING.md) if you would like to help 10 | contribute new examples or improve existing ones. 11 | 12 | 13 | ## Examples 14 | 15 | ### [`Acquire`][Acquire] 16 | 17 | Ensures that a source sequence of disposable objects are all acquired 18 | successfully. If the acquisition of any one fails then those successfully 19 | acquired till that point are disposed. 20 | 21 | ### [`Aggregate`][Aggregate] 22 | 23 | Applies multiple accumulators sequentially in a single pass over a sequence. 24 | 25 | ### [`AggregateRight`][AggregateRight] 26 | 27 | Applies a right-associative accumulator function over a sequence. 28 | This operator is the right-associative version of the Aggregate LINQ operator. 29 | 30 | ### [`Append`][Append] 31 | 32 | Returns a sequence consisting of the head element and the given tail elements. 33 | 34 | ### [`Assert`][Assert] 35 | 36 | Asserts that all elements of a sequence meet a given condition otherwise 37 | throws an exception. 38 | 39 | ### [`AssertCount`][AssertCount] 40 | 41 | Asserts that a source sequence contains a given count of elements. 42 | 43 | ### [`AtLeast`][AtLeast] 44 | 45 | Determines whether or not the number of elements in the sequence is greater 46 | than or equal to the given integer. 47 | 48 | ### [`AtMost`][AtMost] 49 | 50 | Determines whether or not the number of elements in the sequence is lesser 51 | than or equal to the given integer. 52 | 53 | ### [`Backsert`][Backsert] 54 | 55 | Inserts the elements of a sequence into another sequence at a 56 | specified index from the tail of the sequence, where zero always represents 57 | the last position, one represents the second-last element, two represents 58 | the third-last element and so on. 59 | 60 | ### [`Batch`][Batch] 61 | 62 | Batches the source sequence into sized buckets. 63 | 64 | ### [`Cartesian`][Cartesian] 65 | 66 | Returns the Cartesian product of two or more sequences by combining each 67 | element from the sequences and applying a user-defined projection to the 68 | set. 69 | 70 | ### [`Choose`][Choose] 71 | 72 | Applies a function to each element of the source sequence and returns a new 73 | sequence of result elements for source elements where the function returns a 74 | couple (2-tuple) having a `true` as its first element and result as the 75 | second. 76 | 77 | ### [`CompareCount`][CompareCount] 78 | 79 | Compares two sequences and returns an integer that indicates whether the 80 | first sequence has fewer, the same or more elements than the second sequence. 81 | 82 | ### [`Consume`][Consume] 83 | 84 | Completely consumes the given sequence. This method uses immediate execution, 85 | and doesn't store any data during execution 86 | 87 | ### [`CountBetween`][CountBetween] 88 | 89 | Determines whether or not the number of elements in the sequence is between an 90 | inclusive range of minimum and maximum integers. 91 | 92 | ### [`CountBy`][CountBy] 93 | 94 | Applies a key-generating function to each element of a sequence and returns a 95 | sequence of unique keys and their number of occurrences in the original 96 | sequence. 97 | 98 | ### [`CountDown`][CountDown] 99 | 100 | Provides a countdown counter for a given count of elements at the tail of the 101 | sequence where zero always represents the last element, one represents the 102 | second-last element, two represents the third-last element and so on. 103 | 104 | ### [`DistinctBy`][DistinctBy] 105 | 106 | Returns all distinct elements of the given source, where "distinctness" is 107 | determined via a projection and the default equality comparer for the 108 | projected type. 109 | 110 | ### [`EndsWith`][EndsWith] 111 | 112 | Determines whether the end of the first sequence is equivalent to the second 113 | sequence. 114 | 115 | ### [`EquiZip`][EquiZip] 116 | 117 | Returns a projection of tuples, where each tuple contains the N-th 118 | element from each of the argument sequences. An exception is thrown 119 | if the input sequences are of different lengths. 120 | 121 | ### [`Exactly`][Exactly] 122 | 123 | Determines whether or not the number of elements in the sequence is equals 124 | to the given integer. 125 | 126 | ### [`ExceptBy`][ExceptBy] 127 | 128 | Returns the set of elements in the first sequence which aren't in the second 129 | sequence, according to a given key selector. 130 | 131 | ### [`Exclude`][Exclude] 132 | 133 | Excludes elements from a sequence starting at a given index 134 | 135 | ### [`FallbackIfEmpty`][FallbackIfEmpty] 136 | 137 | Returns the elements of a sequence and falls back to another if the original 138 | sequence is empty. 139 | 140 | ### [`FillBackward`][FillBackward] 141 | 142 | Returns a sequence with each null reference or value in the source replaced 143 | with the following non-null reference or value in that sequence. 144 | 145 | ### [`FillForward`][FillForward] 146 | 147 | Returns a sequence with each null reference or value in the source replaced 148 | with the previous non-null reference or value seen in that sequence. 149 | 150 | ### [`Flatten`][Flatten] 151 | 152 | Flattens a sequence containing arbitrarily-nested sequences. 153 | 154 | ### [`Fold`][Fold] 155 | 156 | Returns the result of applying a function to a sequence with 1 to 16 elements. 157 | 158 | ### [`ForEach`][ForEach] 159 | 160 | Immediately executes the given action on each element in the source sequence. 161 | 162 | ### [`From`][From] 163 | 164 | Returns a sequence containing the values resulting from invoking (in order) 165 | each function in the source sequence of functions. 166 | 167 | ### [`FullGroupJoin`][FullGroupJoin] 168 | 169 | Performs a Full Group Join between the and sequences. 170 | 171 | ### [`FullJoin`][FullJoin] 172 | 173 | Performs a full outer join between two sequences. 174 | 175 | ### [`Generate`][Generate] 176 | 177 | Returns a sequence of values consecutively generated by a generator function 178 | 179 | ### [`GenerateByIndex`][GenerateByIndex] 180 | 181 | Returns a sequence of values based on indexes 182 | 183 | ### [`GroupAdjacent`][GroupAdjacent] 184 | 185 | Groups the adjacent elements of a sequence according to a specified key 186 | selector function. 187 | 188 | ### [`Index`][Index] 189 | 190 | Returns a sequence of where the key is the zero-based index of the value in 191 | the source sequence. 192 | 193 | ### [`Insert`][Insert] 194 | 195 | Inserts the elements of a sequence into another sequence at a specified index. 196 | 197 | ### [`Interleave`][Interleave] 198 | 199 | Interleaves the elements of two or more sequences into a single sequence, 200 | skipping sequences as they are consumed. 201 | 202 | ### [`Lag`][Lag] 203 | 204 | Produces a projection of a sequence by evaluating pairs of elements separated 205 | by a negative offset. 206 | 207 | ### [`Lead`][Lead] 208 | 209 | Produces a projection of a sequence by evaluating pairs of elements separated 210 | by a positive offset. 211 | 212 | ### [`LeftJoin`][LeftJoin] 213 | 214 | Performs a left outer join between two sequences. 215 | 216 | ### [`MaxBy`][MaxBy] 217 | 218 | Returns the maxima (maximal elements) of the given sequence, based on the 219 | given projection. 220 | 221 | ### [`MinBy`][MinBy] 222 | 223 | Returns the minima (minimal elements) of the given sequence, based on the 224 | given projection. 225 | 226 | ### [`Move`][Move] 227 | 228 | Returns a sequence with a range of elements in the source sequence 229 | moved to a new offset. 230 | 231 | ### [`OrderBy`][OrderBy] 232 | 233 | Sorts the elements of a sequence in a particular direction (ascending, 234 | descending) according to a key. 235 | 236 | ### [`OrderedMerge`][OrderedMerge] 237 | 238 | Merges two ordered sequences into one. Where the elements equal in both 239 | sequences, the element from the first sequence is returned in the resulting 240 | sequence. 241 | 242 | ### [`Pad`][Pad] 243 | 244 | Pads a sequence with default values if it is narrower (shorter in length) than 245 | a given width. 246 | 247 | ### [`PadStart`][PadStart] 248 | 249 | Pads a sequence with default values in the beginning if it is narrower 250 | (shorter in length) than a given width. 251 | 252 | ### [`Pairwise`][Pairwise] 253 | 254 | Returns a sequence resulting from applying a function to each element in the 255 | source sequence and its predecessor, with the exception of the first element 256 | which is only returned as the predecessor of the second element 257 | 258 | ### [`PartialSort`][PartialSort] 259 | 260 | Combines `OrderBy` (where element is key) and `Take` in a single operation. 261 | 262 | ### [`PartialSortBy`][PartialSortBy] 263 | 264 | Combines `OrderBy` and `Take` in a single operation. 265 | 266 | ### [`Partition`][Partition] 267 | 268 | Partitions a sequence by a predicate, or a grouping by Boolean keys or up to 3 269 | sets of keys. 270 | 271 | ### [`Permutations`][Permutations] 272 | 273 | Generates a sequence of lists that represent the permutations of the original 274 | sequence 275 | 276 | ### [`Pipe`][Pipe] 277 | 278 | Executes the given action on each element in the source sequence and yields it 279 | 280 | ### [`Prepend`][Prepend] 281 | 282 | Prepends a single value to a sequence 283 | 284 | ### [`PreScan`][PreScan] 285 | 286 | Performs a pre-scan (exclusive prefix sum) on a sequence of elements 287 | 288 | ### [`Random`][Random] 289 | 290 | Returns an infinite sequence of random integers using the standard .NET random 291 | number generator. 292 | 293 | ### [`RandomDouble`][RandomDouble] 294 | 295 | Returns an infinite sequence of random double values between 0.0 and 1.0. 296 | 297 | ### [`RandomSubset`][RandomSubset] 298 | 299 | Returns a sequence of a specified size of random elements from the original 300 | sequence. 301 | 302 | ### [`Rank`][Rank] 303 | 304 | Ranks each item in the sequence in descending ordering using a default 305 | comparer. 306 | 307 | ### [`RankBy`][RankBy] 308 | 309 | Ranks each item in the sequence in descending ordering by a specified key 310 | using a default comparer. 311 | 312 | ### [`Repeat`][Repeat] 313 | 314 | Repeats the sequence indefinitely or a specific number of times. 315 | 316 | ### [`RightJoin`][RightJoin] 317 | 318 | Performs a right outer join between two sequences. 319 | 320 | ### [`RunLengthEncode`][RunLengthEncode] 321 | 322 | Run-length encodes a sequence by converting consecutive instances of the same 323 | element into a `KeyValuePair` representing the item and its occurrence 324 | count. 325 | 326 | ### [`Scan`][Scan] 327 | 328 | Peforms a scan (inclusive prefix sum) on a sequence of elements. 329 | 330 | ### [`ScanBy`][ScanBy] 331 | 332 | Applies an accumulator function over sequence element keys, returning the keys 333 | along with intermediate accumulator states. 334 | 335 | ### [`ScanRight`][ScanRight] 336 | 337 | Peforms a right-associative scan (inclusive prefix) on a sequence of elements. 338 | This operator is the right-associative version of the Scan operator. 339 | 340 | ### [`Segment`][Segment] 341 | 342 | Divides a sequence into multiple sequences by using a segment detector based 343 | on the original sequence. 344 | 345 | ### [`Sequence`][Sequence] 346 | 347 | Generates a sequence of integral numbers within the (inclusive) specified range. 348 | 349 | ### [`Shuffle`][Shuffle] 350 | 351 | Returns a sequence of elements in random order from the original sequence. 352 | 353 | ### [`SkipLast`][SkipLast] 354 | 355 | Bypasses a specified number of elements at the end of the sequence. 356 | 357 | ### [`SkipUntil`][SkipUntil] 358 | 359 | Skips items from the input sequence until the given predicate returns true 360 | when applied to the current source item; that item will be the last skipped 361 | 362 | ### [`Slice`][Slice] 363 | 364 | Extracts elements from a sequence at a particular zero-based starting index 365 | 366 | ### [`SortedMerge`][SortedMerge] 367 | 368 | Merges two or more sequences that are in a common order (either ascending or 369 | descending) into a single sequence that preserves that order. 370 | 371 | ### [`Split`][Split] 372 | 373 | Splits the source sequence by a separator. 374 | 375 | ### [`StartsWith`][StartsWith] 376 | 377 | Determines whether the beginning of the first sequence is equivalent to the 378 | second sequence. 379 | 380 | ### [`Subsets`][Subsets] 381 | 382 | Returns a sequence of representing all of the subsets of any size that are 383 | part of the original sequence. 384 | 385 | ### [`TagFirstLast`][TagFirstLast] 386 | 387 | Returns a sequence resulting from applying a function to each element in the 388 | source sequence with additional parameters indicating whether the element is 389 | the first and/or last of the sequence 390 | 391 | ### [`TakeEvery`][TakeEvery] 392 | 393 | Returns every N-th element of a source sequence 394 | 395 | ### [`TakeLast`][TakeLast] 396 | 397 | Returns a specified number of contiguous elements from the end of a sequence 398 | 399 | ### [`TakeUntil`][TakeUntil] 400 | 401 | Returns items from the input sequence until the given predicate returns true 402 | when applied to the current source item; that item will be the last returned 403 | 404 | ### [`ThenBy`][ThenBy] 405 | 406 | Performs a subsequent ordering of elements in a sequence in a particular 407 | direction (ascending, descending) according to a key. 408 | 409 | ### [`ToArrayByIndex`][ToArrayByIndex] 410 | 411 | Creates an array from an IEnumerable where a function is used to determine 412 | the index at which an element will be placed in the array. 413 | 414 | ### [`ToDataTable`][ToDataTable] 415 | 416 | Appends elements in the sequence as rows of a given object with a set of 417 | lambda expressions specifying which members (property or field) of each 418 | element in the sequence will supply the column values. 419 | 420 | ### [`ToDelimitedString`][ToDelimitedString] 421 | 422 | Creates a delimited string from a sequence of values. The delimiter used 423 | depends on the current culture of the executing thread. 424 | 425 | ### [`ToDictionary`][ToDictionary] 426 | 427 | Creates a [dictionary] from a sequence of [key-value pair][kvp] elements 428 | or tuples of 2. 429 | 430 | ### [`ToHashSet`][ToHashSet] 431 | 432 | Returns a [hash-set] of the source items using the default equality 433 | comparer for the type. 434 | 435 | ### [`ToLookup`][ToLookup] 436 | 437 | Creates a [lookup] from a sequence of [key-value pair][kvp] elements 438 | or tuples of 2. 439 | 440 | ### [`Transpose`][Transpose] 441 | 442 | Transposes the rows of a sequence into columns. 443 | 444 | ### [`TraverseBreadthFirst`][TraverseBreadthFirst] 445 | 446 | Traverses a tree in a breadth-first fashion, starting at a root node and using 447 | a user-defined function to get the children at each node of the tree. 448 | 449 | ### [`TraverseDepthFirst`][TraverseDepthFirst] 450 | 451 | Traverses a tree in a depth-first fashion, starting at a root node and using a 452 | user-defined function to get the children at each node of the tree. 453 | 454 | ### [`Trace`][Trace] 455 | 456 | Traces the elements of a source sequence for diagnostics. 457 | 458 | ### [`Unfold`][Unfold] 459 | 460 | Returns a sequence generated by applying a state to the generator function, 461 | and from its result, determines if the sequence should have a next element and 462 | its value, and the next state in the recursive call. 463 | 464 | ### [`Window`][Window] 465 | 466 | Processes a sequence into a series of subsequences representing a windowed 467 | subset of the original 468 | 469 | ### [`WindowLeft`][WindowLeft] 470 | 471 | Creates a left-aligned sliding window over the source sequence of a given size. 472 | 473 | ### [`WindowRight`][WindowRight] 474 | 475 | Creates a right-aligned sliding window over the source sequence of a given size. 476 | 477 | ### [`ZipLongest`][ZipLongest] 478 | 479 | Returns a projection of tuples, where each tuple contains the N-th 480 | element from each of the argument sequences. The resulting sequence 481 | will always be as long as the longest of input sequences where the 482 | default value of each of the shorter sequence element types is used 483 | for padding. 484 | 485 | ### [`ZipShortest`][ZipShortest] 486 | 487 | Returns a projection of tuples, where each tuple contains the N-th 488 | element from each of the argument sequences. The resulting sequence 489 | is as short as the shortest input sequence. 490 | 491 | 492 | ## Experimental Operators 493 | 494 | THESE METHODS ARE EXPERIMENTAL. THEY MAY BE UNSTABLE AND UNTESTED. THEY MAY BE 495 | REMOVED FROM A FUTURE MAJOR OR MINOR RELEASE AND POSSIBLY WITHOUT NOTICE. USE 496 | THEM AT YOUR OWN RISK. THE METHODS ARE PUBLISHED FOR FIELD EXPERIMENTATION TO 497 | SOLICIT FEEDBACK ON THEIR UTILITY AND DESIGN/IMPLEMENTATION DEFECTS. 498 | 499 | Use of experimental methods requires importing the `MoreLinq.Experimental` 500 | namespace. 501 | 502 | ### [`Await`][Await] 503 | 504 | Creates a sequence query that streams the result of each task in the source 505 | sequence as it completes asynchronously. 506 | 507 | ### [`AwaitCompletion`][AwaitCompletion] 508 | 509 | Awaits completion of all asynchronous evaluations irrespective of whether they 510 | succeed or fail. An additional argument specifies a function that projects the 511 | final result given the source item and completed task. 512 | 513 | ### [`Memoize`][Memoize] 514 | 515 | Creates a sequence that lazily caches the source as it is iterated for the 516 | first time, reusing the cache thereafter for future re-iterations. If the 517 | source is already cached or buffered then it is returned verbatim. 518 | 519 | 520 | [MoreLINQ]: https://morelinq.github.io/ 521 | [dotnet-try]: https://github.com/dotnet/try 522 | [dictionary]: https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.Dictionary-2 523 | [hash-set]: https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.hashset-1 524 | [kvp]: https://docs.microsoft.com/en-us/dotnet/api/System.Collections.Generic.KeyValuePair-2 525 | [lookup]: https://docs.microsoft.com/en-us/dotnet/api/system.linq.lookup-2 526 | 527 | [Acquire]: ./m/acquire.md 528 | [Aggregate]: ./m/aggregate.md 529 | [AggregateRight]: ./m/aggregate-right.md 530 | [Append]: ./m/append.md 531 | [Assert]: ./m/assert.md 532 | [AssertCount]: ./m/assert-count.md 533 | [AtLeast]: ./m/at-least.md 534 | [AtMost]: ./m/at-most.md 535 | [Await]: ./m/await.md 536 | [AwaitCompletion]: ./m/await-completion.md 537 | [Backsert]: ./m/backsert.md 538 | [Batch]: ./m/batch.md 539 | [Cartesian]: ./m/cartesian.md 540 | [Choose]: ./m/choose.md 541 | [CompareCount]: ./m/compare-count.md 542 | [Consume]: ./m/consume.md 543 | [CountBetween]: ./m/count-between.md 544 | [CountBy]: ./m/count-by.md 545 | [CountDown]: ./m/count-down.md 546 | [DistinctBy]: ./m/distinct-by.md 547 | [EndsWith]: ./m/ends-with.md 548 | [EquiZip]: ./m/equi-zip.md 549 | [Exactly]: ./m/exactly.md 550 | [ExceptBy]: ./m/except-by.md 551 | [Exclude]: ./m/exclude.md 552 | [FallbackIfEmpty]: ./m/fallback-if-empty.md 553 | [FillBackward]: ./m/fill-backward.md 554 | [FillForward]: ./m/fill-forward.md 555 | [Flatten]: ./m/flatten.md 556 | [Fold]: ./m/fold.md 557 | [ForEach]: ./m/for-each.md 558 | [From]: ./m/from.md 559 | [FullGroupJoin]: ./m/full-group-join.md 560 | [FullJoin]: ./m/full-join.md 561 | [Generate]: ./m/generate.md 562 | [GenerateByIndex]: ./m/generate-by-index.md 563 | [GroupAdjacent]: ./m/group-adjacent.md 564 | [Index]: ./m/index.md 565 | [Insert]: ./m/insert.md 566 | [Interleave]: ./m/interleave.md 567 | [Lag]: ./m/lag.md 568 | [Lead]: ./m/lead.md 569 | [LeftJoin]: ./m/left-join.md 570 | [MaxBy]: ./m/max-by.md 571 | [Memoize]: ./m/memoize.md 572 | [MinBy]: ./m/min-by.md 573 | [Move]: ./m/move.md 574 | [OrderBy]: ./m/order-by.md 575 | [OrderedMerge]: ./m/ordered-merge.md 576 | [Pad]: ./m/pad.md 577 | [PadStart]: ./m/pad-start.md 578 | [Pairwise]: ./m/pairwise.md 579 | [PartialSort]: ./m/partial-sort.md 580 | [PartialSortBy]: ./m/partial-sort-by.md 581 | [Partition]: ./m/partition.md 582 | [Permutations]: ./m/permutations.md 583 | [Pipe]: ./m/pipe.md 584 | [Prepend]: ./m/prepend.md 585 | [PreScan]: ./m/pre-scan.md 586 | [Random]: ./m/random.md 587 | [RandomDouble]: ./m/random-double.md 588 | [RandomSubset]: ./m/random-subset.md 589 | [Rank]: ./m/rank.md 590 | [RankBy]: ./m/rank-by.md 591 | [Repeat]: ./m/repeat.md 592 | [RightJoin]: ./m/right-join.md 593 | [RunLengthEncode]: ./m/run-length-encode.md 594 | [Scan]: ./m/scan.md 595 | [ScanBy]: ./m/scan-by.md 596 | [ScanRight]: ./m/scan-right.md 597 | [Segment]: ./m/segment.md 598 | [Sequence]: ./m/sequence.md 599 | [Shuffle]: ./m/shuffle.md 600 | [SkipLast]: ./m/skip-last.md 601 | [SkipUntil]: ./m/skip-until.md 602 | [Slice]: ./m/slice.md 603 | [SortedMerge]: ./m/sorted-merge.md 604 | [Split]: ./m/split.md 605 | [StartsWith]: ./m/starts-with.md 606 | [Subsets]: ./m/subsets.md 607 | [TagFirstLast]: ./m/tag-first-last.md 608 | [TakeEvery]: ./m/take-every.md 609 | [TakeLast]: ./m/take-last.md 610 | [TakeUntil]: ./m/take-until.md 611 | [ThenBy]: ./m/then-by.md 612 | [ToArrayByIndex]: ./m/to-array-by-index.md 613 | [ToDataTable]: ./m/to-data-table.md 614 | [ToDelimitedString]: ./m/to-delimited-string.md 615 | [ToDictionary]: ./m/to-dictionary.md 616 | [ToHashSet]: ./m/to-hash-set.md 617 | [ToLookup]: ./m/to-lookup.md 618 | [Trace]: ./m/trace.md 619 | [Transpose]: ./m/transpose.md 620 | [TraverseBreadthFirst]: ./m/traverse-breadth-first.md 621 | [TraverseDepthFirst]: ./m/traverse-depth-first.md 622 | [Unfold]: ./m/unfold.md 623 | [Window]: ./m/window.md 624 | [WindowLeft]: ./m/window-left.md 625 | [WindowRight]: ./m/window-right.md 626 | [ZipLongest]: ./m/zip-longest.md 627 | [ZipShortest]: ./m/zip-shortest.md 628 | --------------------------------------------------------------------------------