Пример #1
0
 /// <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);
Пример #2
0
 /// <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);
Пример #3
0
 /// <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);
Пример #4
0
 /// <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);
Пример #5
0
 /// <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);
Пример #6
0
 /// <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);
Пример #7
0
 /// <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);
Пример #8
0
 /// <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);
Пример #9
0
 /// <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);
Пример #10
0
 /// <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);
Пример #11
0
 /// <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);
Пример #12
0
 /// <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);       
Пример #13
0
 /// <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);
Пример #14
0
 /// <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);
Пример #15
0
 /// <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);
Пример #16
0
 /// <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);
Пример #17
0
 /// <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);
Пример #18
0
 /// <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);
Пример #19
0
 /// <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);
Пример #20
0
 /// <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);
Пример #21
0
 /// <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);
Пример #22
0
 /// <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);
Пример #23
0
 /// <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);
Пример #24
0
 /// <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);
Пример #25
0
 /// <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);
Пример #26
0
 /// <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);
Пример #27
0
 /// <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);
Пример #28
0
 /// <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);
Пример #29
0
 /// <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);