예제 #1
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>(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);
예제 #2
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="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>(Schedule schedule, Eff <A> ma, S state, Func <S, A, S> fold, Func <A, bool> pred) =>
 ScheduleEff <A> .FoldWhile(ma, schedule, state, fold, pred);
예제 #3
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>(Eff <A> ma, S state, Func <S, A, S> fold, Func <A, bool> pred) =>
 ScheduleEff <A> .FoldWhile(ma, Schedule.Forever, state, fold, pred);
예제 #4
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>(this Eff <RT, A> ma, Schedule schedule, S state, Func <S, A, S> fold, Func <A, bool> pred) where RT : struct =>
 ScheduleEff <RT, A> .FoldWhile(ma, schedule, state, fold, pred);