public IEitherResult <TLeft, TRight> RunEither() { IEitherResult <TLeft, TRight> result = _self.RunEither(); _action(result); return(result); }
public Unit Run() { IEitherResult <TLeft, TRight> result = _self.Run(); _action(result.Right); return(Unit.Default); }
public Unit RunIdentity() { IEitherResult <TLeft, TRight> result = _self.RunEither(); _action(result.Left); return(Unit.Default); }
public IEitherResult <TLeft, TRight> RunEither() { IEitherResult <TLeft, TRight> result = _self.RunEither(); if (result.IsRight) { _action(result.Right); } return(result); }
public IEitherResult <TLeft, TResultRight> RunEither() { IEitherResult <TLeft, TRight> result = _self.RunEither(); if (result.IsLeft) { return(new LeftResult <TLeft, TResultRight>(result.Left)); } else { return(new RightResult <TLeft, TResultRight>(_selector(result.Right))); } }
public static void Execute <TLeft, TRight>(this IEitherMonad <TLeft, TRight> self) { IEitherResult <TLeft, TRight> selfResult = self.Run(); if (selfResult.IsRight) { return; } else { return; } }
public IEitherResult <TLeft, TRight> Run() { IEitherResult <TLeft, TRight> result = _self.Run(); if (result.IsLeft) { return(new ThrowableLeftResult <TLeft, TRight>(result.Left)); } else { return(new ThrowableRightResult <TLeft, TRight>(result.Right)); } }
public IEitherResult <TLeft, TRight> RunEither() { IEitherResult <TLeft, TRight> result = _self.RunEither(); if (_selector(result)) { return(result); } else { return(_elseSource.RunEither()); } }
public static void Execute <TLeft, TRight>(this IEitherMonad <TLeft, TRight> self, Action <TRight> onRight) { IEitherResult <TLeft, TRight> selfResult = self.RunEither(); if (selfResult.IsRight) { return; } else { onRight(selfResult.Right); return; } }
public TResult Run() { IEitherResult <TLeft, TRight> result = _self.Run(); return(result.IsRight ? _selector(result.Right) : _defaultValue); }
public TResult RunIdentity() { IEitherResult <TLeft, TRight> result = _self.RunEither(); return(result.IsLeft ? _selector(result.Left) : _defaultValue); }