Init Scripts in new repo
This commit is contained in:
14
Functional/IEither.cs
Normal file
14
Functional/IEither.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace SJK.Functional;
|
||||
|
||||
public interface IEither<TLeft, TRight>
|
||||
{
|
||||
IEither<TNewLeft, TRight> MapLeft<TNewLeft>(Func<TLeft, TNewLeft> mapping);
|
||||
IEither<TLeft, TNewRight> MapRight<TNewRight>(Func<TRight, TNewRight> mapping);
|
||||
TLeft Reduce(Func<TRight, TLeft> mapping);
|
||||
(TLeft?, TRight?) Deconstruct();
|
||||
TResult Match<TResult>(Func<TLeft, TResult> left, Func<TRight, TResult> right);
|
||||
void Match(Action<TLeft> left, Action<TRight> right);
|
||||
IEither<TLeft, T2> Bind<T2>(Func<TRight, IEither<TLeft, T2>> value);
|
||||
bool IsRight();
|
||||
bool IsLeft() => !IsRight();
|
||||
}
|
||||
Reference in New Issue
Block a user