You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// 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.
/// <param name="mapper">The function to transform each element.</param>
298
301
/// <param name="reducer">The aggregation function to apply to each pair of transformed elements.</param>
299
302
/// <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
302
305
/// <summary>
303
306
/// 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.
304
307
/// </summary>
308
+
/// <param name="enumerable">The source sequence of Maybe values.</param>
305
309
/// <param name="mapper">The function to transform each element.</param>
306
310
/// <param name="reducer">The aggregation function to apply to each pair of transformed elements.</param>
307
311
/// <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
310
314
/// <summary>
311
315
/// 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.
/// <param name="mapper">The function to transform each element into a sequence.</param>
314
319
/// <param name="reducer">The aggregation function to apply to each pair of transformed elements.</param>
315
320
/// <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
318
323
/// <summary>
319
324
/// 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.
320
325
/// </summary>
326
+
/// <param name="enumerable">The source sequence of Maybe values.</param>
321
327
/// <param name="mapper">The function to transform each element into a sequence.</param>
322
328
/// <param name="reducer">The aggregation function to apply to each pair of transformed elements.</param>
323
329
/// <returns>A Maybe containing the aggregated result of the flat-mapped flattened sequence, or an empty Maybe if empty.</returns>
/// <param name="maybe">The Task of Maybe value.</param>
83
86
/// <param name="selector">The async fallback function to execute if the value is empty.</param>
84
87
/// <returns>A task containing the underlying value or the result of the fallback function.</returns>
85
88
publicstaticasyncTask<R>GetOrAsync<T,R>(thisTask<Maybe<T>>maybe,Func<Unit,Task<R>>selector)whereT:R=>await(awaitmaybe).Match(_ =>selector(Unit.Value), v =>result((R)v)).ConfigureAwait(false);
@@ -122,6 +125,7 @@ public static class MaybeExt
122
125
/// </summary>
123
126
/// <typeparam name="T">The type of the source Maybe value.</typeparam>
124
127
/// <typeparam name="R">The type of the result Maybe value.</typeparam>
128
+
/// <param name="maybe">The Maybe value.</param>
125
129
/// <param name="ifEmpty">The fallback function to execute if the value is empty.</param>
126
130
/// <returns>The first non-empty Maybe, or an empty Maybe.</returns>
127
131
publicstaticMaybe<R>Or<T,R>(thisMaybe<T>maybe,Func<Unit,Maybe<R>>ifEmpty)whereT:R=>maybe.Match(_ =>ifEmpty(Unit.Value), v =>Maybe.Create((R)v));
@@ -133,6 +137,7 @@ public static class MaybeExt
133
137
/// </summary>
134
138
/// <typeparam name="T">The type of the source Maybe value.</typeparam>
135
139
/// <typeparam name="R">The type of the result Maybe value.</typeparam>
140
+
/// <param name="maybe">The Maybe value.</param>
136
141
/// <param name="ifEmpty">The async fallback function to execute if the value is empty.</param>
137
142
/// <returns>A task containing the first non-empty Maybe, or an empty Maybe.</returns>
/// <typeparam name="T">The type of the source Maybe value.</typeparam>
146
151
/// <typeparam name="R">The type of the result Maybe value.</typeparam>
152
+
/// <param name="maybe">The Task of Maybe value.</param>
147
153
/// <param name="ifEmpty">The async fallback function to execute if the value is empty.</param>
148
154
/// <returns>A task containing the first non-empty Maybe, or an empty Maybe.</returns>
149
155
publicstaticasyncTask<Maybe<R>>OrAsync<T,R>(thisTask<Maybe<T>>maybe,Func<Unit,Task<Maybe<R>>>ifEmpty)whereT:R=>await(awaitmaybe).Match(_ =>ifEmpty(Unit.Value), v =>Maybe.Create((R)v).ToTask()).ConfigureAwait(false);
0 commit comments