Beispiel #1
0
 public static void Case <TToken, T>(
     this IReply <TToken, T> reply,
     Action <ITokenStream <TToken>, String> failure,
     Action <ITokenStream <TToken>, T> success)
 {
     reply.Case(
         failure: (stream, errorMessage) =>
         { failure(stream, errorMessage); return(Unit.Instance); },
         success: (stream, value) =>
         { success(stream, value); return(Unit.Instance); });
 }
Beispiel #2
0
 public static bool IsSuccess <TToken, T>(this IReply <TToken, T> reply)
 => reply.Case((_, __) => false, (_, __) => true);