CSharpFunctionalExtensions
CSharpFunctionalExtensions copied to clipboard
Missing Match for UnitResult
I miss the following Match
method for UnitResult
:
static class MatchUnitResult
{
public static R Match<E, R>(this UnitResult<E> result, Func<R> success, Func<E, R> failure) =>
result.IsSuccess
? success()
: failure(result.Error);
}
Thanks for reporting this. Feel free to submit a PR as well.
This method is already implemented, so I believe this issue could be closed.
https://github.com/vkhorikov/CSharpFunctionalExtensions/blob/7eb1ae86570ebf6057eb446fdf1cd3f6cc1d0be8/CSharpFunctionalExtensions/Result/Methods/Extensions/Match.cs#L43-L48