Beispiel #1
0
 public static Process <T> RepeatUntil <T>(this Process <T> p, Func <bool> predicate)
 {
     return(p.Concat(() => predicate() ? new Halt <T>(End.Only) : p.RepeatUntil(predicate)));
 }
Beispiel #2
0
 public static Process <T> While <T>(this Process <T> p, Func <bool> predicate)
 {
     return(Await <T> .Create(predicate, either => either.Match(
                                  left: e => new Halt <T>(e),
                                  right: b => b ? p.Concat(() => p.While(predicate)) : new Halt <T>(End.Only))));
 }
Beispiel #3
0
 public static Process <T> Repeat <T>(this Process <T> p1)
 {
     return(p1.Concat(p1.Repeat));
 }