Exemple #1
0
 public static Either <Unit, T> ToEither <T>(this Maybe <T> self) => self.Match(x => Either.New <Unit, T>(x), () => Unit.Default);
 public static Either <TRight, TLeft> Swap <TLeft, TRight>(this Either <TLeft, TRight> self) =>
 self.Match(
     x => Either <TRight, TLeft> .New(x),
     x => Either <TRight, TLeft> .New(x)
     );