Esempio n. 1
0
 // Bifunctor
 public static IEither <L1, R1> SelectBoth <L, L1, R, R1>(
     this IEither <L, R> source,
     Func <L, L1> selectLeft,
     Func <R, R1> selectRight)
 {
     return(source.Accept(
                new SelectBothVisitor <L, L1, R, R1>(selectLeft, selectRight)));
 }
Esempio n. 2
0
 // Monad
 public static IEither <L, R> Join <L, R>(
     this IEither <L, IEither <L, R> > source)
 {
     return(source.Accept(new JoinVisitor <L, R>()));
 }
Esempio n. 3
0
 // Bifoldable - sort of... Really, the T involved should give rise to a
 // monoid
 public static T Bifold <T>(this IEither <T, T> source)
 {
     return(source.Accept(new BifoldVisitor <T>()));
 }