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); }); }
public static bool IsSuccess <TToken, T>(this IReply <TToken, T> reply) => reply.Case((_, __) => false, (_, __) => true);