public static bool IsRight <TLeft, TRight>(this Either <TLeft, TRight> either) { return(either.Tag == EitherType.Right); }
public static Either <TLeft, TResult> Bind <TLeft, TRight, TResult>( this Either <TLeft, TRight> either, Func <TRight, Either <TLeft, TResult> > func) { return(Either.Bind(either, func)); }
public static Either <TLeft, TResult> Map <TLeft, TRight, TResult>( this Either <TLeft, TRight> either, Func <TRight, TResult> func) { return(Either.Map(either, func)); }
/// <summary> /// Equivalent to monadic <see cref="CSharpx.Either.Return{TRight}"/> operation. /// Builds a <see cref="CSharpx.Right{TLeft, TRight}"/> value in case <paramref name="value"/> by default. /// </summary> public static Either <string, TRight> ToEither <TRight>(this TRight value) { return(Either.Return <TRight>(value)); }