Init Scripts in new repo

This commit is contained in:
2026-04-04 13:18:04 -04:00
commit d988008613
26 changed files with 1497 additions and 0 deletions

14
Functional/IEither.cs Normal file
View 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();
}