Exemplo n.º 1
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 Aff <S> foldUntil <S, A>(Aff <A> ma, S state, Func <S, A, S> fold, Func <A, bool> pred) =>
 ScheduleAff <A> .FoldUntil(ma, Schedule.Forever, state, fold, pred);
Exemplo n.º 2
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 Aff <RT, S> foldUntil <RT, S, A>(Schedule schedule, Aff <RT, A> ma, S state, Func <S, A, S> fold, Func <A, bool> pred)
     where RT : struct, HasCancel <RT> =>
 ScheduleAff <RT, A> .FoldUntil(ma, schedule, state, fold, pred);
Exemplo n.º 3
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 Aff <S> foldUntil <S, A>(Schedule schedule, Aff <A> ma, S state, Func <S, A, S> fold, Func <A, bool> pred) =>
 ScheduleAff <A> .FoldUntil(ma, schedule, state, fold, pred);