Skip to content

Commit 03b489b

Browse files
committed
removed missing xml param due to new extension method approach
1 parent ecaa57d commit 03b489b

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

Funk/Extensions/EnumerableExt.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public static class EnumerableExt
1616
/// Pattern-matches on the sequence. Handles null sequence.
1717
/// In case of more items, performs aggregation.
1818
/// </summary>
19+
/// <param name="sequence">The source sequence.</param>
1920
/// <param name="ifEmpty">The function to execute when the sequence is empty.</param>
2021
/// <param name="ifSingle">The function to execute when the sequence contains a single element.</param>
2122
/// <param name="ifMultiple">The aggregation function to execute when the sequence contains multiple elements.</param>
@@ -287,13 +288,15 @@ public IImmutableList<Record<TKey, IImmutableList<T>>> ToRecordList<TKey>(Func<T
287288
/// <summary>
288289
/// Aggregates sequence of not empty Maybes to the specified result as Maybe. Handles null sequence.
289290
/// </summary>
291+
/// <param name="enumerable">The source sequence of Maybe values.</param>
290292
/// <param name="reducer">The aggregation function to apply to each pair of elements.</param>
291293
/// <returns>A Maybe containing the aggregated result, or an empty Maybe if no non-empty Maybes exist.</returns>
292294
public static Maybe<T> Fold<T>(this IEnumerable<Maybe<T>> enumerable, Func<T, T, T> reducer) => enumerable.Flatten().Reduce(reducer);
293295

294296
/// <summary>
295297
/// Maps the specified sequence to an immutable sequence of specified type and aggregates sequence of the new type to the specified result as Maybe. Handles null sequence.
296298
/// </summary>
299+
/// <param name="enumerable">The source sequence.</param>
297300
/// <param name="mapper">The function to transform each element.</param>
298301
/// <param name="reducer">The aggregation function to apply to each pair of transformed elements.</param>
299302
/// <returns>A Maybe containing the aggregated result of the mapped sequence, or an empty Maybe if the sequence is empty.</returns>
@@ -302,6 +305,7 @@ public IImmutableList<Record<TKey, IImmutableList<T>>> ToRecordList<TKey>(Func<T
302305
/// <summary>
303306
/// Maps the specified sequence to an immutable sequence of not empty maybes and aggregates sequence of the new type to the specified result as Maybe. Handles null sequence.
304307
/// </summary>
308+
/// <param name="enumerable">The source sequence of Maybe values.</param>
305309
/// <param name="mapper">The function to transform each element.</param>
306310
/// <param name="reducer">The aggregation function to apply to each pair of transformed elements.</param>
307311
/// <returns>A Maybe containing the aggregated result of the mapped flattened sequence, or an empty Maybe if empty.</returns>
@@ -310,6 +314,7 @@ public IImmutableList<Record<TKey, IImmutableList<T>>> ToRecordList<TKey>(Func<T
310314
/// <summary>
311315
/// Maps the specified sequence to an immutable sequence of specified type and aggregates sequence of the new type to the specified result as Maybe. Handles null sequence.
312316
/// </summary>
317+
/// <param name="enumerable">The source sequence.</param>
313318
/// <param name="mapper">The function to transform each element into a sequence.</param>
314319
/// <param name="reducer">The aggregation function to apply to each pair of transformed elements.</param>
315320
/// <returns>A Maybe containing the aggregated result of the flat-mapped sequence, or an empty Maybe if the sequence is empty.</returns>
@@ -318,6 +323,7 @@ public IImmutableList<Record<TKey, IImmutableList<T>>> ToRecordList<TKey>(Func<T
318323
/// <summary>
319324
/// Maps the specified sequence of not empty maybes to an immutable sequence of specified type and aggregates sequence of the new type to the specified result as Maybe. Handles null sequence.
320325
/// </summary>
326+
/// <param name="enumerable">The source sequence of Maybe values.</param>
321327
/// <param name="mapper">The function to transform each element into a sequence.</param>
322328
/// <param name="reducer">The aggregation function to apply to each pair of transformed elements.</param>
323329
/// <returns>A Maybe containing the aggregated result of the flat-mapped flattened sequence, or an empty Maybe if empty.</returns>

Funk/Extensions/ExcExt.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public async Task<Exc<T, E2>> MapFailureAsync<E2>(Func<EnumerableException<E1>,
8888
/// <typeparam name="T">The original success type.</typeparam>
8989
/// <typeparam name="E">The exception type.</typeparam>
9090
/// <typeparam name="R">The recovered success type.</typeparam>
91+
/// <param name="operationResult">The Exc to recover from.</param>
9192
/// <param name="recoverOperation">The recovery function.</param>
9293
/// <returns>The recovered Exc or the original success.</returns>
9394
public static Exc<R, E> OnFailure<T, E, R>(this Exc<T, E> operationResult, Func<EnumerableException<E>, R> recoverOperation) where T : R where E : Exception => operationResult.OnFlatFailure(e => Exc.Create<R, E>(_ => recoverOperation(e)));
@@ -99,6 +100,7 @@ public async Task<Exc<T, E2>> MapFailureAsync<E2>(Func<EnumerableException<E1>,
99100
/// <typeparam name="T">The original success type.</typeparam>
100101
/// <typeparam name="E">The exception type.</typeparam>
101102
/// <typeparam name="R">The recovered success type.</typeparam>
103+
/// <param name="operationResult">The Exc to recover from.</param>
102104
/// <param name="recoverOperation">The recovery function returning an Exc.</param>
103105
/// <returns>The recovered Exc or the original success.</returns>
104106
public static Exc<R, E> OnFlatFailure<T, E, R>(this Exc<T, E> operationResult, Func<EnumerableException<E>, Exc<R, E>> recoverOperation) where T : R where E : Exception
@@ -117,6 +119,7 @@ public static Exc<R, E> OnFlatFailure<T, E, R>(this Exc<T, E> operationResult, F
117119
/// <typeparam name="T">The original success type.</typeparam>
118120
/// <typeparam name="E">The exception type.</typeparam>
119121
/// <typeparam name="R">The recovered success type.</typeparam>
122+
/// <param name="operationResult">The Task of Exc to recover from.</param>
120123
/// <param name="recoverOperation">The async recovery function.</param>
121124
/// <returns>A Task of the recovered Exc or the original success.</returns>
122125
public static async Task<Exc<R, E>> OnFailureAsync<T, E, R>(this Task<Exc<T, E>> operationResult, Func<EnumerableException<E>, Task<R>> recoverOperation) where T : R where E : Exception => await OnFailureAsync(await operationResult, recoverOperation).ConfigureAwait(false);
@@ -128,6 +131,7 @@ public static Exc<R, E> OnFlatFailure<T, E, R>(this Exc<T, E> operationResult, F
128131
/// <typeparam name="T">The original success type.</typeparam>
129132
/// <typeparam name="E">The exception type.</typeparam>
130133
/// <typeparam name="R">The recovered success type.</typeparam>
134+
/// <param name="operationResult">The Task of Exc to recover from.</param>
131135
/// <param name="recoverOperation">The async recovery function returning an Exc.</param>
132136
/// <returns>A Task of the recovered Exc or the original success.</returns>
133137
public static async Task<Exc<R, E>> OnFlatFailureAsync<T, E, R>(this Task<Exc<T, E>> operationResult, Func<EnumerableException<E>, Task<Exc<R, E>>> recoverOperation) where T : R where E : Exception => await (await operationResult).OnFlatFailureAsync(recoverOperation).ConfigureAwait(false);
@@ -139,6 +143,7 @@ public static Exc<R, E> OnFlatFailure<T, E, R>(this Exc<T, E> operationResult, F
139143
/// <typeparam name="T">The original success type.</typeparam>
140144
/// <typeparam name="E">The exception type.</typeparam>
141145
/// <typeparam name="R">The recovered success type.</typeparam>
146+
/// <param name="operationResult">The Exc to recover from.</param>
142147
/// <param name="recoverOperation">The async recovery function.</param>
143148
/// <returns>A Task of the recovered Exc or the original success.</returns>
144149
public static Task<Exc<R, E>> OnFailureAsync<T, E, R>(this Exc<T, E> operationResult, Func<EnumerableException<E>, Task<R>> recoverOperation) where T : R where E : Exception => operationResult.OnFlatFailureAsync(e => Exc.CreateAsync<R, E>(_ => recoverOperation(e)));
@@ -150,6 +155,7 @@ public static Exc<R, E> OnFlatFailure<T, E, R>(this Exc<T, E> operationResult, F
150155
/// <typeparam name="T">The original success type.</typeparam>
151156
/// <typeparam name="E">The exception type.</typeparam>
152157
/// <typeparam name="R">The recovered success type.</typeparam>
158+
/// <param name="operationResult">The Exc to recover from.</param>
153159
/// <param name="recoverOperation">The async recovery function returning an Exc.</param>
154160
/// <returns>A Task of the recovered Exc or the original success.</returns>
155161
public static Task<Exc<R, E>> OnFlatFailureAsync<T, E, R>(this Exc<T, E> operationResult, Func<EnumerableException<E>, Task<Exc<R, E>>> recoverOperation) where T : R where E : Exception
@@ -168,6 +174,7 @@ public static Task<Exc<R, E>> OnFlatFailureAsync<T, E, R>(this Exc<T, E> operati
168174
/// <typeparam name="T">The original success type.</typeparam>
169175
/// <typeparam name="E">The exception type.</typeparam>
170176
/// <typeparam name="R">The recovered success type.</typeparam>
177+
/// <param name="operationResult">The Exc to recover from.</param>
171178
/// <param name="recoverOperation">The recovery function.</param>
172179
/// <returns>The recovered Exc or the original success or failure.</returns>
173180
public static Exc<R, E> OnEmpty<T, E, R>(this Exc<T, E> operationResult, Func<Unit, R> recoverOperation) where T : R where E : Exception => operationResult.OnFlatEmpty(_ => Exc.Create<R, E>(recoverOperation));
@@ -179,6 +186,7 @@ public static Task<Exc<R, E>> OnFlatFailureAsync<T, E, R>(this Exc<T, E> operati
179186
/// <typeparam name="T">The original success type.</typeparam>
180187
/// <typeparam name="E">The exception type.</typeparam>
181188
/// <typeparam name="R">The recovered success type.</typeparam>
189+
/// <param name="operationResult">The Exc to recover from.</param>
182190
/// <param name="recoverOperation">The recovery function returning an Exc.</param>
183191
/// <returns>The recovered Exc or the original success or failure.</returns>
184192
public static Exc<R, E> OnFlatEmpty<T, E, R>(this Exc<T, E> operationResult, Func<Unit, Exc<R, E>> recoverOperation) where T : R where E : Exception
@@ -197,6 +205,7 @@ public static Exc<R, E> OnFlatEmpty<T, E, R>(this Exc<T, E> operationResult, Fun
197205
/// <typeparam name="T">The original success type.</typeparam>
198206
/// <typeparam name="E">The exception type.</typeparam>
199207
/// <typeparam name="R">The recovered success type.</typeparam>
208+
/// <param name="operationResult">The Task of Exc to recover from.</param>
200209
/// <param name="recoverOperation">The async recovery function.</param>
201210
/// <returns>A Task of the recovered Exc or the original success or failure.</returns>
202211
public static async Task<Exc<R, E>> OnEmptyAsync<T, E, R>(this Task<Exc<T, E>> operationResult, Func<Unit, Task<R>> recoverOperation) where T : R where E : Exception => await (await operationResult).OnEmptyAsync(recoverOperation).ConfigureAwait(false);
@@ -208,6 +217,7 @@ public static Exc<R, E> OnFlatEmpty<T, E, R>(this Exc<T, E> operationResult, Fun
208217
/// <typeparam name="T">The original success type.</typeparam>
209218
/// <typeparam name="E">The exception type.</typeparam>
210219
/// <typeparam name="R">The recovered success type.</typeparam>
220+
/// <param name="operationResult">The Task of Exc to recover from.</param>
211221
/// <param name="recoverOperation">The async recovery function returning an Exc.</param>
212222
/// <returns>A Task of the recovered Exc or the original success or failure.</returns>
213223
public static async Task<Exc<R, E>> OnFlatEmptyAsync<T, E, R>(this Task<Exc<T, E>> operationResult, Func<Unit, Task<Exc<R, E>>> recoverOperation) where T : R where E : Exception => await (await operationResult).OnFlatEmptyAsync(recoverOperation).ConfigureAwait(false);
@@ -219,6 +229,7 @@ public static Exc<R, E> OnFlatEmpty<T, E, R>(this Exc<T, E> operationResult, Fun
219229
/// <typeparam name="T">The original success type.</typeparam>
220230
/// <typeparam name="E">The exception type.</typeparam>
221231
/// <typeparam name="R">The recovered success type.</typeparam>
232+
/// <param name="operationResult">The Exc to recover from.</param>
222233
/// <param name="recoverOperation">The async recovery function.</param>
223234
/// <returns>A Task of the recovered Exc or the original success or failure.</returns>
224235
public static Task<Exc<R, E>> OnEmptyAsync<T, E, R>(this Exc<T, E> operationResult, Func<Unit, Task<R>> recoverOperation) where T : R where E : Exception => operationResult.OnFlatEmptyAsync(_ => Exc.CreateAsync<R, E>(recoverOperation));
@@ -230,6 +241,7 @@ public static Exc<R, E> OnFlatEmpty<T, E, R>(this Exc<T, E> operationResult, Fun
230241
/// <typeparam name="T">The original success type.</typeparam>
231242
/// <typeparam name="E">The exception type.</typeparam>
232243
/// <typeparam name="R">The recovered success type.</typeparam>
244+
/// <param name="operationResult">The Exc to recover from.</param>
233245
/// <param name="recoverOperation">The async recovery function returning an Exc.</param>
234246
/// <returns>A Task of the recovered Exc or the original success or failure.</returns>
235247
public static Task<Exc<R, E>> OnFlatEmptyAsync<T, E, R>(this Exc<T, E> operationResult, Func<Unit, Task<Exc<R, E>>> recoverOperation) where T : R where E : Exception

Funk/Extensions/MaybeExt.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public static class MaybeExt
6060
/// </summary>
6161
/// <typeparam name="T">The type of the Maybe value.</typeparam>
6262
/// <typeparam name="R">The return type.</typeparam>
63+
/// <param name="maybe">The Maybe value.</param>
6364
/// <param name="selector">The fallback function to execute if the value is empty.</param>
6465
/// <returns>The underlying value or the result of the fallback function.</returns>
6566
public static R GetOr<T, R>(this Maybe<T> maybe, Func<Unit, R> selector) where T : R => maybe.Match(_ => selector(Unit.Value), v => v);
@@ -70,6 +71,7 @@ public static class MaybeExt
7071
/// </summary>
7172
/// <typeparam name="T">The type of the Maybe value.</typeparam>
7273
/// <typeparam name="R">The return type.</typeparam>
74+
/// <param name="maybe">The Maybe value.</param>
7375
/// <param name="selector">The async fallback function to execute if the value is empty.</param>
7476
/// <returns>A task containing the underlying value or the result of the fallback function.</returns>
7577
public static Task<R> GetOrAsync<T, R>(this Maybe<T> maybe, Func<Unit, Task<R>> selector) where T : R => maybe.ToTask().GetOrAsync(selector);
@@ -80,6 +82,7 @@ public static class MaybeExt
8082
/// </summary>
8183
/// <typeparam name="T">The type of the Maybe value.</typeparam>
8284
/// <typeparam name="R">The return type.</typeparam>
85+
/// <param name="maybe">The Task of Maybe value.</param>
8386
/// <param name="selector">The async fallback function to execute if the value is empty.</param>
8487
/// <returns>A task containing the underlying value or the result of the fallback function.</returns>
8588
public static async Task<R> GetOrAsync<T, R>(this Task<Maybe<T>> maybe, Func<Unit, Task<R>> selector) where T : R => await (await maybe).Match(_ => selector(Unit.Value), v => result((R)v)).ConfigureAwait(false);
@@ -122,6 +125,7 @@ public static class MaybeExt
122125
/// </summary>
123126
/// <typeparam name="T">The type of the source Maybe value.</typeparam>
124127
/// <typeparam name="R">The type of the result Maybe value.</typeparam>
128+
/// <param name="maybe">The Maybe value.</param>
125129
/// <param name="ifEmpty">The fallback function to execute if the value is empty.</param>
126130
/// <returns>The first non-empty Maybe, or an empty Maybe.</returns>
127131
public static Maybe<R> Or<T, R>(this Maybe<T> maybe, Func<Unit, Maybe<R>> ifEmpty) where T : R => maybe.Match(_ => ifEmpty(Unit.Value), v => Maybe.Create((R)v));
@@ -133,6 +137,7 @@ public static class MaybeExt
133137
/// </summary>
134138
/// <typeparam name="T">The type of the source Maybe value.</typeparam>
135139
/// <typeparam name="R">The type of the result Maybe value.</typeparam>
140+
/// <param name="maybe">The Maybe value.</param>
136141
/// <param name="ifEmpty">The async fallback function to execute if the value is empty.</param>
137142
/// <returns>A task containing the first non-empty Maybe, or an empty Maybe.</returns>
138143
public static Task<Maybe<R>> OrAsync<T, R>(this Maybe<T> maybe, Func<Unit, Task<Maybe<R>>> ifEmpty) where T : R => maybe.ToTask().OrAsync(ifEmpty);
@@ -144,6 +149,7 @@ public static class MaybeExt
144149
/// </summary>
145150
/// <typeparam name="T">The type of the source Maybe value.</typeparam>
146151
/// <typeparam name="R">The type of the result Maybe value.</typeparam>
152+
/// <param name="maybe">The Task of Maybe value.</param>
147153
/// <param name="ifEmpty">The async fallback function to execute if the value is empty.</param>
148154
/// <returns>A task containing the first non-empty Maybe, or an empty Maybe.</returns>
149155
public static async Task<Maybe<R>> OrAsync<T, R>(this Task<Maybe<T>> maybe, Func<Unit, Task<Maybe<R>>> ifEmpty) where T : R => await (await maybe).Match(_ => ifEmpty(Unit.Value), v => Maybe.Create((R)v).ToTask()).ConfigureAwait(false);

0 commit comments

Comments
 (0)