Example #1
0
 public static Program.Parser <C> SelectMany <A, B, C>(
     this Program.Parser <A> parser,
     Func <A, Program.Parser <B> > function,
     Func <A, B, C> projection)
 {
     return(parser.Bind(
                outer => function(outer).Bind(
                    inner => projection(outer, inner).Unit())));
 }
Example #2
0
 public static Program.Parser <B> Select <A, B>(
     this Program.Parser <A> parser, Func <A, B> function)
 {
     return(parser.Bind(a => function(a).Unit()));
 }