Beispiel #1
0
 public static IParseResult <TResult> SelectMany <T1, T2, TResult>(
     this IParseResult <T1> parsed,
     Func <T1, IParseResult <T2> > bindResultToParser,
     Func <T1, T2, TResult> select)
 {
     return(parsed.Select(x => bindResultToParser(x).Select(
                              y => select(x, y))
                          ));
 }
Beispiel #2
0
 public static IParseResult <TResult> Select <T, TResult>(
     this IParseResult <T> parsed,
     Func <T, TResult> func)
 {
     return(parsed.Select(x => Parse.Success(func(x))));
 }