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
/// <summary>Returns <paramref name="source"/> if it is not faulted, otherwise evaluates <paramref name="fallbackThunk"/> and returns the result.</summary>
428
+
///
429
+
/// <param name="fallbackThunk">A thunk that provides an alternate task computation when evaluated.</param>
430
+
/// <param name="source">The input task.</param>
431
+
///
432
+
/// <returns>The task if it is not faulted, else the result of evaluating <paramref name="fallbackThunk"/>.</returns>
433
+
/// <remarks><paramref name="fallbackThunk"/> is not evaluated unless <paramref name="source"/> is faulted.</remarks>
434
+
///
435
+
let inlineorElseWith([<InlineIfLambda>]fallbackThunk:exn ->Task<'T>)(source:Task<'T>):Task<'T>=
436
+
letsource= nullArgCheck (nameof source) source
437
+
tryWith (fun()-> source) fallbackThunk
438
+
439
+
/// <summary>Returns <paramref name="source"/> if it is not faulted, otherwise e<paramref name="fallbackTask"/>.</summary>
440
+
///
441
+
/// <param name="fallbackTask">The alternative Task to use if <paramref name="source"/> is faulted.</param>
442
+
/// <param name="source">The input task.</param>
443
+
///
444
+
/// <returns>The option if the option is Some, else the alternate option.</returns>
/// <summary>Returns <paramref name="source"/> if it is not faulted, otherwise evaluates <paramref name="fallbackThunk"/> and returns the result.</summary>
299
+
///
300
+
/// <param name="fallbackThunk">A thunk that provides an alternate task computation when evaluated.</param>
301
+
/// <param name="source">The input task.</param>
302
+
///
303
+
/// <returns>The task if it is not faulted, else the result of evaluating <paramref name="fallbackThunk"/>.</returns>
304
+
/// <remarks><paramref name="fallbackThunk"/> is not evaluated unless <paramref name="source"/> is faulted.</remarks>
305
+
///
306
+
let inlineorElseWith([<InlineIfLambda>]fallbackThunk:exn ->ValueTask<'T>)(source:ValueTask<'T>):ValueTask<'T>= tryWith fallbackThunk (fun()-> source)
307
+
308
+
/// <summary>Returns <paramref name="source"/> if it is not faulted, otherwise e<paramref name="fallbackValueTask"/>.</summary>
309
+
///
310
+
/// <param name="fallbackValueTask">The alternative ValueTask to use if <paramref name="source"/> is faulted.</param>
311
+
/// <param name="source">The input task.</param>
312
+
///
313
+
/// <returns>The option if the option is Some, else the alternate option.</returns>
0 commit comments