-
Notifications
You must be signed in to change notification settings - Fork 14
ApplyOnFailure extension method for Result<Unit, TFailure>
#128
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
base: master
Are you sure you want to change the base?
Conversation
|
I debated whether the I'm open to being convinced otherwise. |
|
The version of Apply which does not require handling for failure is currently marked as obsolete. The idea was that when terminating a chain of functions you should always handle both cases. If we put this in, we'd also need to un-obsolete those methods. I'm a bit on the fence. |
|
For a bit of background,
I disagree that the other methods need to be un-obsoleted for the generic I can see how it might be (initially) confusing to library consumers though. |
|
If I recall, the reasons for explicitly handling both cases for
However, I think it's the specificity of Where I sit fence-wise is my uncertainty around just defining it for |
I agree with this, which is why I constrained Example usage: The Could use |
|
It's an interesting example you posted, I might suggest a refactor: Not that I believe you're referring in general to cases that always involve a Anyways, I lean towards adding Or maybe there is value in being that explicit? If so, I'd probably introduce an extension method |
|
Just coming back to this. Sorry, slipped my mind. If we add ApplyOnFailure, should there also be an ApplyOnSuccess? |
|
Yea, I think the same argument about the naming being explicit also applies to |
I'm on board with that Also on board with adding |

No description provided.