Exemplo n.º 1
0
 public Either <L, T> ToEither <L>(Func <L> Left) =>
 IsSome
         ? Prelude.Right <L, T>(Value)
         : Prelude.Left <L, T>(Left());
Exemplo n.º 2
0
 public static Either <L, R> ForceLeft <L, R>(this Either <L, R> either, Func <R, L> force)
 {
     return(either.Bind(
                _ => Prelude.Left <L, R>(force(_))));
 }
Exemplo n.º 3
0
 public Either <L, T> ToEither <L>(L defaultLeftValue) =>
 IsSome
         ? Prelude.Right <L, T>(Value)
         : Prelude.Left <L, T>(defaultLeftValue);