Esempio n. 1
0
 /// <summary></summary>
 public static R To <L, R>(this Either <L, R> self, Func <L, R> map)
 => self.IfLeft(map, Functional.Id);
Esempio n. 2
0
 /// <summary></summary>
 public static L To <L, R>(this Either <L, R> self, Func <R, L> map)
 => self.IfRight(map, Functional.Id);
Esempio n. 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));
Esempio n. 4
0
 /// <summary></summary>
 public static Either <L, R> Return <L, R>(R right)
 => Either <L, R> .Right(right);
Esempio n. 5
0
 /// <summary></summary>
 public static Either <L, R> Return <L, R>(TypeMarker <L> _, R right)
 => Either <L, R> .Right(right);
Esempio n. 6
0
 /// <summary></summary>
 public static Either <L, R> Return <L, R>(L left, TypeMarker <R> _)
 => Either <L, R> .Left(left);
Esempio n. 7
0
 /// <summary></summary>
 public static Either <L, R> Return <L, R>(L left)
 => Either <L, R> .Left(left);