Beispiel #1
0
 public EitherTC <TLeft, TReturn> Apply <TReturn>(EitherTC <TLeft, Func <TRight, TReturn> > f)
 {
     if (f.IsRight)
     {
         return(this.FMap <TReturn>(f.ToRight().Value));
     }
     else
     {
         return(EitherTC <TLeft> .Left <TReturn>(f.ToLeft().Value));
     }
 }
Beispiel #2
0
 public EitherTC <TLeft, TReturn> ApplyRight <TReturn>(EitherTC <TLeft, TReturn> other)
 {
     return(other);
 }
Beispiel #3
0
 public EitherTC <TLeft, TRight> ApplyLeft <TReturn>(EitherTC <TLeft, TReturn> other)
 {
     return(this);
 }
Beispiel #4
0
 public override EitherTC <TLeft, TReturn> ComputeWith <TReturn>(Func <TRight, EitherTC <TLeft, TReturn> > f)
 {
     return(EitherTC <TLeft> .Left <TReturn>(this.Value));
 }