예제 #1
0
 /// <summary></summary>
 public static Either <L, R> Do <L, R>(this Either <L, R> self, Action <R> func)
 => self.IfRight(
     right => {
     func(right);
     return(self);
 },
     _ => self);
예제 #2
0
 /// <summary></summary>
 public static L To <L, R>(this Either <L, R> self, Func <R, L> map)
 => self.IfRight(map, Functional.Id);
예제 #3
0
 /// <summary>LとRを交換</summary>
 public static Either <R, L> Swap <R, L>(this Either <L, R> self)
 => self.IfRight(
     r => Either <R, L> .Left(r),
     l => Either <R, L> .Right(l));