We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Would this be possible ?
using System; namespace CSharpFunctionalExtensions { public static partial class MaybeExtensions { public static Result<T, E> ToResult<T, E>(in this Maybe<T> maybe, Func<E> errorFactory) { if (maybe.HasNoValue) return Result.Failure<T, E>(errorFactory()); return Result.Success<T, E>(maybe.GetValueOrThrow()); } } }
It would avoid calling expensive error building code when maybe has a value.
The text was updated successfully, but these errors were encountered:
Sorry for the late answer. Yeah, the overload looks good to me.
Sorry, something went wrong.
No branches or pull requests
Would this be possible ?
It would avoid calling expensive error building code when maybe has a value.
The text was updated successfully, but these errors were encountered: