-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7cad7a9
commit 9eb27ce
Showing
4 changed files
with
99 additions
and
39 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
Docs/SuperLinq.Docs/apidoc/SuperLinq.SuperEnumerable.ScanRight.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
uid: ScanRight``1(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``0,``0}) | ||
example: [*content] | ||
--- | ||
The following code example demonstrates how to execute a right-associative post-fix scan by key on a sequence using `ScanRight`. | ||
[!code-csharp[](SuperLinq/ScanBy/ScanBy1.linq#L6-)] | ||
|
||
--- | ||
uid: ScanRight``2(System.Collections.Generic.IEnumerable{``0},``1,System.Func{``0,``1,``1}) | ||
example: [*content] | ||
--- | ||
The following code example demonstrates how to execute a right-associative post-fix scan by key on a sequence using `ScanRight`. | ||
[!code-csharp[](SuperLinq/ScanBy/ScanBy2.linq#L6-)] |
19 changes: 19 additions & 0 deletions
19
Docs/SuperLinq.Docs/apidoc/SuperLinq/ScanRight/ScanRight1.linq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<Query Kind="Statements"> | ||
<NuGetReference>SuperLinq</NuGetReference> | ||
<Namespace>SuperLinq</Namespace> | ||
</Query> | ||
|
||
var sequence = Enumerable.Range(1, 5) | ||
.Select(x => x.ToString()); | ||
|
||
// execute a scan of the sequence | ||
var result = sequence | ||
.ScanRight((a, b) => $"({a}+{b})"); | ||
|
||
Console.WriteLine( | ||
"[ \"" + | ||
string.Join("\", \"", result) + | ||
"\" ]"); | ||
|
||
// This code produces the following output: | ||
// [ "(1+(2+(3+(4+5))))", "(2+(3+(4+5)))", "(3+(4+5))", "(4+5)", "5" ] |
20 changes: 20 additions & 0 deletions
20
Docs/SuperLinq.Docs/apidoc/SuperLinq/ScanRight/ScanRight2.linq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<Query Kind="Statements"> | ||
<NuGetReference>SuperLinq</NuGetReference> | ||
<Namespace>SuperLinq</Namespace> | ||
</Query> | ||
|
||
var sequence = Enumerable.Range(1, 5); | ||
|
||
// execute a scan of the sequence | ||
var result = sequence | ||
.ScanRight( | ||
"6", | ||
(a, b) => $"({a}+{b})"); | ||
|
||
Console.WriteLine( | ||
"[ \"" + | ||
string.Join("\", \"", result) + | ||
"\" ]"); | ||
|
||
// This code produces the following output: | ||
// [ "(1+(2+(3+(4+(5+6)))))", "(2+(3+(4+(5+6))))", "(3+(4+(5+6)))", "(4+(5+6))", "(5+6)", "6" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters