/Scharps.Either

Primary LanguageC#MIT LicenseMIT

Scharps.Either

Either is a light result library to distinguish between errors and successful results without the use of exceptions.

Usage

Result<Error> failedResult = CouldFail();
Result<Error, string> successfulResult = SuccessfulResult();

if (successfulResult.Value is string s)
{
    System.Console.WriteLine(s);
}
else if (successfulResult.Error is IError e)
{
    System.Console.WriteLine(e.Message);
}