Skip to content

Commit

Permalink
Update documentation for Fold
Browse files Browse the repository at this point in the history
  • Loading branch information
viceroypenguin committed Sep 4, 2023
1 parent 82eb04a commit bc43d2e
Show file tree
Hide file tree
Showing 19 changed files with 719 additions and 153 deletions.
112 changes: 112 additions & 0 deletions Docs/SuperLinq.Docs/apidoc/SuperLinq.SuperEnumerable.Fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
uid: SuperLinq.SuperEnumerable.Fold``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``1})
example: [*content]
---
The following code example demonstrates how to apply a projection to a sequence of 1 element using `Fold`.
[!code-csharp[](SuperLinq/Fold/Fold1.linq#L6-)]

---
uid: SuperLinq.SuperEnumerable.Fold``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``0,``1})
example: [*content]
---
The following code example demonstrates how to apply a projection to a sequence of 2 elements using `Fold`.
[!code-csharp[](SuperLinq/Fold/Fold2.linq#L6-)]

---
uid: SuperLinq.SuperEnumerable.Fold``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``0,``0,``1})
example: [*content]
---
The following code example demonstrates how to apply a projection to a sequence of 3 elements using `Fold`.
[!code-csharp[](SuperLinq/Fold/Fold3.linq#L6-)]

---
uid: SuperLinq.SuperEnumerable.Fold``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``0,``0,``0,``1})
example: [*content]
---
The following code example demonstrates how to apply a projection to a sequence of 4 elements using `Fold`.
[!code-csharp[](SuperLinq/Fold/Fold4.linq#L6-)]

---
uid: SuperLinq.SuperEnumerable.Fold``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``0,``0,``0,``0,``1})
example: [*content]
---
The following code example demonstrates how to apply a projection to a sequence of 5 elements using `Fold`.
[!code-csharp[](SuperLinq/Fold/Fold5.linq#L6-)]

---
uid: SuperLinq.SuperEnumerable.Fold``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``0,``0,``0,``0,``0,``1})
example: [*content]
---
The following code example demonstrates how to apply a projection to a sequence of 6 elements using `Fold`.
[!code-csharp[](SuperLinq/Fold/Fold6.linq#L6-)]

---
uid: SuperLinq.SuperEnumerable.Fold``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``0,``0,``0,``0,``0,``0,``1})
example: [*content]
---
The following code example demonstrates how to apply a projection to a sequence of 7 elements using `Fold`.
[!code-csharp[](SuperLinq/Fold/Fold7.linq#L6-)]

---
uid: SuperLinq.SuperEnumerable.Fold``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``1})
example: [*content]
---
The following code example demonstrates how to apply a projection to a sequence of 8 elements using `Fold`.
[!code-csharp[](SuperLinq/Fold/Fold8.linq#L6-)]

---
uid: SuperLinq.SuperEnumerable.Fold``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``0,``1})
example: [*content]
---
The following code example demonstrates how to apply a projection to a sequence of 9 elements using `Fold`.
[!code-csharp[](SuperLinq/Fold/Fold9.linq#L6-)]

---
uid: SuperLinq.SuperEnumerable.Fold``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``1})
example: [*content]
---
The following code example demonstrates how to apply a projection to a sequence of 10 elements using `Fold`.
[!code-csharp[](SuperLinq/Fold/Fold10.linq#L6-)]

---
uid: SuperLinq.SuperEnumerable.Fold``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``1})
example: [*content]
---
The following code example demonstrates how to apply a projection to a sequence of 11 elements using `Fold`.
[!code-csharp[](SuperLinq/Fold/Fold11.linq#L6-)]

---
uid: SuperLinq.SuperEnumerable.Fold``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``1})
example: [*content]
---
The following code example demonstrates how to apply a projection to a sequence of 12 elements using `Fold`.
[!code-csharp[](SuperLinq/Fold/Fold12.linq#L6-)]

---
uid: SuperLinq.SuperEnumerable.Fold``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``1})
example: [*content]
---
The following code example demonstrates how to apply a projection to a sequence of 13 elements using `Fold`.
[!code-csharp[](SuperLinq/Fold/Fold13.linq#L6-)]

---
uid: SuperLinq.SuperEnumerable.Fold``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``1})
example: [*content]
---
The following code example demonstrates how to apply a projection to a sequence of 14 elements using `Fold`.
[!code-csharp[](SuperLinq/Fold/Fold14.linq#L6-)]

---
uid: SuperLinq.SuperEnumerable.Fold``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``1})
example: [*content]
---
The following code example demonstrates how to apply a projection to a sequence of 15 elements using `Fold`.
[!code-csharp[](SuperLinq/Fold/Fold15.linq#L6-)]

---
uid: SuperLinq.SuperEnumerable.Fold``2(System.Collections.Generic.IEnumerable{``0},System.Func{``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``0,``1})
example: [*content]
---
The following code example demonstrates how to apply a projection to a sequence of 16 elements using `Fold`.
[!code-csharp[](SuperLinq/Fold/Fold16.linq#L6-)]

15 changes: 15 additions & 0 deletions Docs/SuperLinq.Docs/apidoc/SuperLinq/Fold/Fold1.linq
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Query Kind="Statements">
<NuGetReference>SuperLinq</NuGetReference>
<Namespace>SuperLinq</Namespace>
</Query>

var sequence = Enumerable.Range(1, 1);

// Fold a sequence into a single value.
var result = sequence
.Fold((a) => a);

Console.WriteLine(result);

// This code produces the following output:
// 1
16 changes: 16 additions & 0 deletions Docs/SuperLinq.Docs/apidoc/SuperLinq/Fold/Fold10.linq
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Query Kind="Statements">
<NuGetReference>SuperLinq</NuGetReference>
<Namespace>SuperLinq</Namespace>
</Query>

var sequence = Enumerable.Range(1, 10);

// Fold a sequence into a single value.
var result = sequence
.Fold((a, b, c, d, e, f, g, h, i, j) =>
a + b + c + d + e + f + g + h + i + j);

Console.WriteLine(result);

// This code produces the following output:
// 55
16 changes: 16 additions & 0 deletions Docs/SuperLinq.Docs/apidoc/SuperLinq/Fold/Fold11.linq
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Query Kind="Statements">
<NuGetReference>SuperLinq</NuGetReference>
<Namespace>SuperLinq</Namespace>
</Query>

var sequence = Enumerable.Range(1, 11);

// Fold a sequence into a single value.
var result = sequence
.Fold((a, b, c, d, e, f, g, h, i, j, k) =>
a + b + c + d + e + f + g + h + i + j + k);

Console.WriteLine(result);

// This code produces the following output:
// 66
16 changes: 16 additions & 0 deletions Docs/SuperLinq.Docs/apidoc/SuperLinq/Fold/Fold12.linq
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Query Kind="Statements">
<NuGetReference>SuperLinq</NuGetReference>
<Namespace>SuperLinq</Namespace>
</Query>

var sequence = Enumerable.Range(1, 12);

// Fold a sequence into a single value.
var result = sequence
.Fold((a, b, c, d, e, f, g, h, i, j, k, l) =>
a + b + c + d + e + f + g + h + i + j + k + l);

Console.WriteLine(result);

// This code produces the following output:
// 78
16 changes: 16 additions & 0 deletions Docs/SuperLinq.Docs/apidoc/SuperLinq/Fold/Fold13.linq
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Query Kind="Statements">
<NuGetReference>SuperLinq</NuGetReference>
<Namespace>SuperLinq</Namespace>
</Query>

var sequence = Enumerable.Range(1, 13);

// Fold a sequence into a single value.
var result = sequence
.Fold((a, b, c, d, e, f, g, h, i, j, k, l, m) =>
a + b + c + d + e + f + g + h + i + j + k + l + m);

Console.WriteLine(result);

// This code produces the following output:
// 91
16 changes: 16 additions & 0 deletions Docs/SuperLinq.Docs/apidoc/SuperLinq/Fold/Fold14.linq
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Query Kind="Statements">
<NuGetReference>SuperLinq</NuGetReference>
<Namespace>SuperLinq</Namespace>
</Query>

var sequence = Enumerable.Range(1, 14);

// Fold a sequence into a single value.
var result = sequence
.Fold((a, b, c, d, e, f, g, h, i, j, k, l, m, n) =>
a + b + c + d + e + f + g + h + i + j + k + l + m + n);

Console.WriteLine(result);

// This code produces the following output:
// 105
16 changes: 16 additions & 0 deletions Docs/SuperLinq.Docs/apidoc/SuperLinq/Fold/Fold15.linq
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Query Kind="Statements">
<NuGetReference>SuperLinq</NuGetReference>
<Namespace>SuperLinq</Namespace>
</Query>

var sequence = Enumerable.Range(1, 15);

// Fold a sequence into a single value.
var result = sequence
.Fold((a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) =>
a + b + c + d + e + f + g + h + i + j + k + l + m + n + o);

Console.WriteLine(result);

// This code produces the following output:
// 120
16 changes: 16 additions & 0 deletions Docs/SuperLinq.Docs/apidoc/SuperLinq/Fold/Fold16.linq
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Query Kind="Statements">
<NuGetReference>SuperLinq</NuGetReference>
<Namespace>SuperLinq</Namespace>
</Query>

var sequence = Enumerable.Range(1, 16);

// Fold a sequence into a single value.
var result = sequence
.Fold((a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) =>
a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p);

Console.WriteLine(result);

// This code produces the following output:
// 136
15 changes: 15 additions & 0 deletions Docs/SuperLinq.Docs/apidoc/SuperLinq/Fold/Fold2.linq
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Query Kind="Statements">
<NuGetReference>SuperLinq</NuGetReference>
<Namespace>SuperLinq</Namespace>
</Query>

var sequence = Enumerable.Range(1, 2);

// Fold a sequence into a single value.
var result = sequence
.Fold((a, b) => a + b);

Console.WriteLine(result);

// This code produces the following output:
// 3
15 changes: 15 additions & 0 deletions Docs/SuperLinq.Docs/apidoc/SuperLinq/Fold/Fold3.linq
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Query Kind="Statements">
<NuGetReference>SuperLinq</NuGetReference>
<Namespace>SuperLinq</Namespace>
</Query>

var sequence = Enumerable.Range(1, 3);

// Fold a sequence into a single value.
var result = sequence
.Fold((a, b, c) => a + b + c);

Console.WriteLine(result);

// This code produces the following output:
// 6
15 changes: 15 additions & 0 deletions Docs/SuperLinq.Docs/apidoc/SuperLinq/Fold/Fold4.linq
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Query Kind="Statements">
<NuGetReference>SuperLinq</NuGetReference>
<Namespace>SuperLinq</Namespace>
</Query>

var sequence = Enumerable.Range(1, 4);

// Fold a sequence into a single value.
var result = sequence
.Fold((a, b, c, d) => a + b + c + d);

Console.WriteLine(result);

// This code produces the following output:
// 10
15 changes: 15 additions & 0 deletions Docs/SuperLinq.Docs/apidoc/SuperLinq/Fold/Fold5.linq
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Query Kind="Statements">
<NuGetReference>SuperLinq</NuGetReference>
<Namespace>SuperLinq</Namespace>
</Query>

var sequence = Enumerable.Range(1, 5);

// Fold a sequence into a single value.
var result = sequence
.Fold((a, b, c, d, e) => a + b + c + d + e);

Console.WriteLine(result);

// This code produces the following output:
// 15
15 changes: 15 additions & 0 deletions Docs/SuperLinq.Docs/apidoc/SuperLinq/Fold/Fold6.linq
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Query Kind="Statements">
<NuGetReference>SuperLinq</NuGetReference>
<Namespace>SuperLinq</Namespace>
</Query>

var sequence = Enumerable.Range(1, 6);

// Fold a sequence into a single value.
var result = sequence
.Fold((a, b, c, d, e, f) => a + b + c + d + e + f);

Console.WriteLine(result);

// This code produces the following output:
// 21
16 changes: 16 additions & 0 deletions Docs/SuperLinq.Docs/apidoc/SuperLinq/Fold/Fold7.linq
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Query Kind="Statements">
<NuGetReference>SuperLinq</NuGetReference>
<Namespace>SuperLinq</Namespace>
</Query>

var sequence = Enumerable.Range(1, 7);

// Fold a sequence into a single value.
var result = sequence
.Fold((a, b, c, d, e, f, g) =>
a + b + c + d + e + f + g);

Console.WriteLine(result);

// This code produces the following output:
// 28
16 changes: 16 additions & 0 deletions Docs/SuperLinq.Docs/apidoc/SuperLinq/Fold/Fold8.linq
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Query Kind="Statements">
<NuGetReference>SuperLinq</NuGetReference>
<Namespace>SuperLinq</Namespace>
</Query>

var sequence = Enumerable.Range(1, 8);

// Fold a sequence into a single value.
var result = sequence
.Fold((a, b, c, d, e, f, g, h) =>
a + b + c + d + e + f + g + h);

Console.WriteLine(result);

// This code produces the following output:
// 36
16 changes: 16 additions & 0 deletions Docs/SuperLinq.Docs/apidoc/SuperLinq/Fold/Fold9.linq
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Query Kind="Statements">
<NuGetReference>SuperLinq</NuGetReference>
<Namespace>SuperLinq</Namespace>
</Query>

var sequence = Enumerable.Range(1, 9);

// Fold a sequence into a single value.
var result = sequence
.Fold((a, b, c, d, e, f, g, h, i) =>
a + b + c + d + e + f + g + h + i);

Console.WriteLine(result);

// This code produces the following output:
// 45
Loading

0 comments on commit bc43d2e

Please sign in to comment.