Ejemplo n.º 1
0
 public static Either <A, X> Swap <X, A>(this Either <X, A> either)
 {
     return(either.Cata(Right <A, X>, Left <A, X>));
 }
Ejemplo n.º 2
0
 public static A RightOr <X, A>(this Either <X, A> either, Func <A> or)
 {
     return(either.Cata(x => or(), a => a));
 }
Ejemplo n.º 3
0
 public static bool IsRight <X, A>(this Either <X, A> either)
 {
     return(either.Cata(x => false, a => true));
 }
Ejemplo n.º 4
0
 public static X LeftOr <X, A>(this Either <X, A> either, Func <X> or)
 {
     return(either.Cata(x => x, a => or()));
 }
Ejemplo n.º 5
0
 public Either <X, A> Op(Either <X, A> t1, Either <X, A> t2)
 {
     return(t1.Cata(x => t2, a => t1));
 }