-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
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
ResultAsMaybe #597
base: master
Are you sure you want to change the base?
ResultAsMaybe #597
Conversation
Also, I've used TestBase instead of creating random types and data. Please confirm I'm using it properly. |
LGTM, as mentioned in #594 I think it'd make sense to add this extension to |
Thank you @bothzoli , i'll work it out and update this. What about the other points i mention in the PR? |
Oh yeah, sorry: 1 - I'll pass on this one. (I'm also merely another enthusiastic contributor to this repo, so I'm sorry I can't give more exact answers :)) |
Thanks for your input, may be @vkhorikov can help us out with task / value task. In the meantime i'll see about UnitResult and update the PR. |
@bothzoli I've looked into |
Ahh yeah, now that I think about it, you're perfectly right. By definition a |
This is a pretty simple implementation. I've explored implementations of other features of the repo and I'd need clarification regarding 3 points:
Task and ValueTask implementations, should we have them? I will check similar features in depth and try to replicate them, although I'd appreciate some indications.
I've seen
#if NET5_0_OR_GREATER
in a few places, I'm not sure if this is something I should take into account and if or how it affects this feature.Result with both Success and null value: Apparently this is possible, which I guess it makes sense if you want to imply that an operation was successful even though the result is null. As far as I understand (in a Maybe), if the Value is
null
, HasValue has to befalse
. I added a test for this but it might not make sense since it is not possible to create a Maybe containing null.I know there's a lot missing here. Please point me in the right direction and I'll keep working on it.