Example #1
0
 public static Either <L, RR> Map <L, R, RR>(this Either <L, R> either, Func <R, RR> func)
 => either.Match <Either <L, RR> >(l => Left(l), r => Right(func(r)));
Example #2
0
 public static Either <L, P> SelectMany <L, R, RR, P>(this Either <L, R> either, Func <R, Either <L, RR> > bind,
                                                      Func <R, RR, P> project) => either.Match(
     l => Left(l),
     r => bind(either.Right).Match <Either <L, P> >(
         l => Left(l),
         rr => project(r, rr)));
Example #3
0
 public static Either <L, Unit> ForEach <L, R>(this Either <L, R> either, Action <R> action)
 => Map(either, action.ToFunc());
Example #4
0
 public static Either <L, RR> Select <L, R, RR>(this Either <L, R> either, Func <R, RR> func)
 => either.Map(func);
Example #5
0
 public static Either <L, RR> Bind <L, R, RR>(this Either <L, R> either, Func <R, RR> func)
 => either.Match <Either <L, RR> >(l => Left(l), r => func(r));