/// <summary> /// Keeps repeating the computation until it fails or the predicate returns true /// </summary> /// <param name="schedule">Scheduler strategy for repeating</param> /// <param name="ma">Computation to repeat</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff<RT, A> RepeatUntil<RT, A>(this Eff<RT, A> ma, Schedule schedule, Func<A, bool> predicate) where RT : struct => ScheduleEff<RT, A>.RepeatUntil(ma, schedule, predicate);
/// <summary> /// Fold over the effect repeatedly until the schedule expires or the effect fails /// </summary> /// <param name="ma">Effect to fold over</param> /// <param name="schedule">Scheduler that controls the number of folds and the delay between each fold iteration</param> /// <param name="state">Initial state</param> /// <param name="fold">Folder function</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="S">State type</typeparam> /// <typeparam name="A">Bound value type</typeparam> /// <returns>The result of the fold operation</returns> public static Eff <RT, S> fold <RT, S, A>(Schedule schedule, Eff <RT, A> ma, S state, Func <S, A, S> fold) where RT : struct => ScheduleEff <RT, A> .Fold(ma, schedule, state, fold);
/// <summary> /// Fold over the effect repeatedly until the effect fails /// </summary> /// <param name="ma">Effect to fold over</param> /// <param name="state">Initial state</param> /// <param name="fold">Folder function</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="S">State type</typeparam> /// <typeparam name="A">Bound value type</typeparam> /// <returns>The result of the fold operation</returns> public static Eff <RT, S> fold <RT, S, A>(Eff <RT, A> ma, S state, Func <S, A, S> fold) where RT : struct => ScheduleEff <RT, A> .Fold(ma, Schedule.Forever, state, fold);
/// <summary> /// Fold over the effect repeatedly until the schedule expires or the effect fails /// </summary> /// <param name="ma">Effect to fold over</param> /// <param name="schedule">Scheduler that controls the number of folds and the delay between each fold iteration</param> /// <param name="state">Initial state</param> /// <param name="fold">Folder function</param> /// <typeparam name="S">State type</typeparam> /// <typeparam name="A">Bound value type</typeparam> /// <returns>The result of the fold operation</returns> public static Eff <S> fold <S, A>(Schedule schedule, Eff <A> ma, S state, Func <S, A, S> fold) => ScheduleEff <A> .Fold(ma, schedule, state, fold);
/// <summary> /// Fold over the effect repeatedly until the effect fails /// </summary> /// <param name="ma">Effect to fold over</param> /// <param name="state">Initial state</param> /// <param name="fold">Folder function</param> /// <typeparam name="S">State type</typeparam> /// <typeparam name="A">Bound value type</typeparam> /// <returns>The result of the fold operation</returns> public static Eff <S> fold <S, A>(Eff <A> ma, S state, Func <S, A, S> fold) => ScheduleEff <A> .Fold(ma, Schedule.Forever, state, fold);
/// <summary> /// Keeps repeating the computation until it fails or the predicate returns false /// </summary> /// <param name="ma">Computation to repeat</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff <RT, A> repeatWhile <RT, A>(Eff <RT, A> ma, Func <A, bool> predicate) where RT : struct => ScheduleEff <RT, A> .RepeatWhile(ma, Schedule.Forever, predicate);
/// <summary> /// Keeps repeating the computation until it fails or the predicate returns false /// </summary> /// <param name="schedule">Scheduler strategy for repeating</param> /// <param name="ma">Computation to repeat</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff <RT, A> repeatWhile <RT, A>(Schedule schedule, Eff <RT, A> ma, Func <A, bool> predicate) where RT : struct => ScheduleEff <RT, A> .RepeatWhile(ma, schedule, predicate);
/// <summary> /// Fold over the effect repeatedly until the effect fails or the predicate returns false /// </summary> /// <param name="ma">Effect to fold over</param> /// <param name="state">Initial state</param> /// <param name="fold">Folder function</param> /// <param name="pred">Predicate function - when this returns false, the fold ends</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="S">State type</typeparam> /// <typeparam name="A">Bound value type</typeparam> /// <returns>The result of the fold operation</returns> public static Eff <RT, S> FoldWhile <RT, S, A>(this Eff <RT, A> ma, S state, Func <S, A, S> fold, Func <A, bool> pred) where RT : struct => ScheduleEff <RT, A> .FoldWhile(ma, Schedule.Forever, state, fold, pred);
/// <summary> /// Keeps retrying the computation until the predicate returns true /// </summary> /// <param name="ma">Computation to retry</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff <RT, A> retryUntil <RT, A>(Eff <RT, A> ma, Func <Error, bool> predicate) where RT : struct => ScheduleEff <RT, A> .RetryUntil(ma, Schedule.Forever, predicate);
/// <summary> /// Fold over the effect repeatedly until the effect fails or the predicate returns false /// </summary> /// <param name="ma">Effect to fold over</param> /// <param name="state">Initial state</param> /// <param name="fold">Folder function</param> /// <param name="pred">Predicate function - when this returns false, the fold ends</param> /// <typeparam name="S">State type</typeparam> /// <typeparam name="A">Bound value type</typeparam> /// <returns>The result of the fold operation</returns> public static Eff <S> FoldWhile <S, A>(this Eff <A> ma, S state, Func <S, A, S> fold, Func <A, bool> pred) => ScheduleEff <A> .FoldWhile(ma, Schedule.Forever, state, fold, pred);
/// <summary> /// Fold over the effect repeatedly until the schedule expires, the effect fails, or the predicate returns true /// </summary> /// <param name="ma">Effect to fold over</param> /// <param name="schedule">Scheduler that controls the number of folds and the delay between each fold iteration</param> /// <param name="state">Initial state</param> /// <param name="fold">Folder function</param> /// <param name="pred">Predicate function - when this returns true, the fold ends</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="S">State type</typeparam> /// <typeparam name="A">Bound value type</typeparam> /// <returns>The result of the fold operation</returns> public static Eff <RT, S> FoldUntil <RT, S, A>(this Eff <RT, A> ma, Schedule schedule, S state, Func <S, A, S> fold, Func <A, bool> pred) where RT : struct => ScheduleEff <RT, A> .FoldUntil(ma, schedule, state, fold, pred);
/// <summary> /// Keeps repeating the computation until it fails /// </summary> /// <param name="schedule">Scheduler strategy for repeating</param> /// <param name="ma">Computation to repeat</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff<A> Repeat<A>(this Eff<A> ma, Schedule schedule) => ScheduleEff<A>.Repeat(ma, schedule);
/// <summary> /// Keeps repeating the computation until it fails /// </summary> /// <param name="schedule">Scheduler strategy for repeating</param> /// <param name="ma">Computation to repeat</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff<RT, A> Repeat<RT, A>(this Eff<RT, A> ma, Schedule schedule) where RT : struct => ScheduleEff<RT, A>.Repeat(ma, schedule);
/// <summary> /// Keeps repeating the computation until it fails or the predicate returns true /// </summary> /// <param name="schedule">Scheduler strategy for repeating</param> /// <param name="ma">Computation to repeat</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff<A> RepeatUntil<A>(this Eff<A> ma, Schedule schedule, Func<A, bool> predicate) => ScheduleEff<A>.RepeatUntil(ma, schedule, predicate);
/// <summary> /// Keeps repeating the computation until it fails /// </summary> /// <param name="schedule">Scheduler strategy for repeating</param> /// <param name="ma">Computation to repeat</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff <RT, A> repeat <RT, A>(Schedule schedule, Eff <RT, A> ma) where RT : struct => ScheduleEff <RT, A> .Repeat(ma, schedule);
/// <summary> /// Keeps retrying the computation, until the scheduler expires, or the predicate returns true /// </summary> /// <param name="schedule">Scheduler strategy for retrying</param> /// <param name="ma">Computation to retry</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff <RT, A> retryUntil <RT, A>(Schedule schedule, Eff <RT, A> ma, Func <Error, bool> predicate) where RT : struct => ScheduleEff <RT, A> .RetryUntil(ma, schedule, predicate);
/// <summary> /// Keeps repeating the computation until it fails /// </summary> /// <param name="schedule">Scheduler strategy for repeating</param> /// <param name="ma">Computation to repeat</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff <A> repeat <A>(Schedule schedule, Eff <A> ma) => ScheduleEff <A> .Repeat(ma, schedule);
/// <summary> /// Keeps retrying the computation /// </summary> /// <param name="ma">Computation to retry</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff <A> retry <A>(Eff <A> ma) => ScheduleEff <A> .Retry(ma, Schedule.Forever);
/// <summary> /// Keeps repeating the computation until it fails or the predicate returns false /// </summary> /// <param name="ma">Computation to repeat</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff <A> repeatWhile <A>(Eff <A> ma, Func <A, bool> predicate) => ScheduleEff <A> .RepeatWhile(ma, Schedule.Forever, predicate);
/// <summary> /// Keeps retrying the computation, until the scheduler expires /// </summary> /// <param name="schedule">Scheduler strategy for retrying</param> /// <param name="ma">Computation to retry</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff <A> retry <A>(Schedule schedule, Eff <A> ma) => ScheduleEff <A> .Retry(ma, schedule);
/// <summary> /// Keeps repeating the computation until it fails or the predicate returns false /// </summary> /// <param name="schedule">Scheduler strategy for repeating</param> /// <param name="ma">Computation to repeat</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff <A> repeatWhile <A>(Schedule schedule, Eff <A> ma, Func <A, bool> predicate) => ScheduleEff <A> .RepeatWhile(ma, schedule, predicate);
/// <summary> /// Keeps retrying the computation until the predicate returns false /// </summary> /// <param name="ma">Computation to retry</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff <A> retryWhile <A>(Eff <A> ma, Func <Error, bool> predicate) => ScheduleEff <A> .RetryWhile(ma, Schedule.Forever, predicate);
/// <summary> /// Fold over the effect repeatedly until the schedule expires, the effect fails, or the predicate returns true /// </summary> /// <param name="ma">Effect to fold over</param> /// <param name="schedule">Scheduler that controls the number of folds and the delay between each fold iteration</param> /// <param name="state">Initial state</param> /// <param name="fold">Folder function</param> /// <param name="pred">Predicate function - when this returns true, the fold ends</param> /// <typeparam name="S">State type</typeparam> /// <typeparam name="A">Bound value type</typeparam> /// <returns>The result of the fold operation</returns> public static Eff <S> foldUntil <S, A>(Schedule schedule, Eff <A> ma, S state, Func <S, A, S> fold, Func <A, bool> pred) => ScheduleEff <A> .FoldUntil(ma, schedule, state, fold, pred);
/// <summary> /// Keeps retrying the computation, until the scheduler expires, or the predicate returns false /// </summary> /// <param name="schedule">Scheduler strategy for retrying</param> /// <param name="ma">Computation to retry</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff <A> retryWhile <A>(Schedule schedule, Eff <A> ma, Func <Error, bool> predicate) => ScheduleEff <A> .RetryWhile(ma, schedule, predicate);
/// <summary> /// Fold over the effect repeatedly until the effect fails or the predicate returns true /// </summary> /// <param name="ma">Effect to fold over</param> /// <param name="state">Initial state</param> /// <param name="fold">Folder function</param> /// <param name="pred">Predicate function - when this returns true, the fold ends</param> /// <typeparam name="S">State type</typeparam> /// <typeparam name="A">Bound value type</typeparam> /// <returns>The result of the fold operation</returns> public static Eff <S> foldUntil <S, A>(Eff <A> ma, S state, Func <S, A, S> fold, Func <A, bool> pred) => ScheduleEff <A> .FoldUntil(ma, Schedule.Forever, state, fold, pred);
/// <summary> /// Keeps repeating the computation until it fails /// </summary> /// <param name="ma">Computation to repeat</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff <RT, A> repeat <RT, A>(Eff <RT, A> ma) where RT : struct => ScheduleEff <RT, A> .Repeat(ma, Schedule.Forever);
/// <summary> /// Fold over the effect repeatedly until the schedule expires, the effect fails, or the predicate returns false /// </summary> /// <param name="ma">Effect to fold over</param> /// <param name="schedule">Scheduler that controls the number of folds and the delay between each fold iteration</param> /// <param name="state">Initial state</param> /// <param name="fold">Folder function</param> /// <param name="pred">Predicate function - when this returns false, the fold ends</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="S">State type</typeparam> /// <typeparam name="A">Bound value type</typeparam> /// <returns>The result of the fold operation</returns> public static Eff <RT, S> foldWhile <RT, S, A>(Schedule schedule, Eff <RT, A> ma, S state, Func <S, A, S> fold, Func <A, bool> pred) where RT : struct => ScheduleEff <RT, A> .FoldWhile(ma, schedule, state, fold, pred);
/// <summary> /// Keeps repeating the computation until it fails /// </summary> /// <param name="ma">Computation to repeat</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff <A> repeat <A>(Eff <A> ma) => ScheduleEff <A> .Repeat(ma, Schedule.Forever);
/// <summary> /// Fold over the effect repeatedly until the effect fails or the predicate returns true /// </summary> /// <param name="ma">Effect to fold over</param> /// <param name="state">Initial state</param> /// <param name="fold">Folder function</param> /// <param name="pred">Predicate function - when this returns true, the fold ends</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="S">State type</typeparam> /// <typeparam name="A">Bound value type</typeparam> /// <returns>The result of the fold operation</returns> public static Eff <RT, S> foldUntil <RT, S, A>(Eff <RT, A> ma, S state, Func <S, A, S> fold, Func <A, bool> pred) where RT : struct => ScheduleEff <RT, A> .FoldUntil(ma, Schedule.Forever, state, fold, pred);
/// <summary> /// Keeps retrying the computation, until the scheduler expires, or the predicate returns false /// </summary> /// <param name="schedule">Scheduler strategy for repeating</param> /// <param name="ma">Computation to repeat</param> /// <typeparam name="RT">Runtime</typeparam> /// <typeparam name="A">Computation bound value type</typeparam> /// <returns>The result of the last invocation of ma</returns> public static Eff <RT, A> RetryWhile <RT, A>(this Eff <RT, A> ma, Schedule schedule, Func <Error, bool> predicate) where RT : struct => ScheduleEff <RT, A> .RetryWhile(ma, schedule, predicate);