-
Notifications
You must be signed in to change notification settings - Fork 21
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
Result module parity with Options #1123
Comments
I'm generally a fan of this, with one exception... Instead of add I'd even be happy with both modules having a function named |
Also, do we want a version of some or most of these that works on the error instead of the result? Considering that there is already a |
@pblasucci Maybe off topic, but I think it would be even more valuable to deprecate option's |
@theprash Oh, for sure. I'd like to see them both go the way of the dodo. And, in truth, I'd expect changes to the surface of |
The original suggestion looks entirely reasonable, I'll mark it as approved. I agree with omitting Result.get. We can consider Option.get in a separate suggestion
I think not. |
Good
Seq-like, unclear why only Oks chosenThese assume that Solutions:
Bad
|
When adding this, I would want us to consider adding InlineIfLambda attribute to appropriate parameters. This discussion suggests putting it in Option/ValueOption and I'd assume we'd want the same for Result for the same reasons. I implemented this recently in FsToolkit.ErrorHandling and the performance/SharpLap really speak to why I think it would be worth doing in FSharp.Core. |
I started with the RFC here: |
I'd actually like I could live with |
I just read the RFC, for the function: |
Agreed, FsToolkit should have done this and I regret not doing it sooner. It’s easy to throw away the error if it doesn’t matter. |
@gusty would you like to make a PR to the RFC? I generally agree |
Done, thank you both for the quick feedback. |
@vzarytovskii I think this can be closed now that has been implemented :). Might be worth adding Option, ValueOption, Result to be eligible to use |
Result module parity with Options
I propose we add
to the
Result
module to have parity withOption
andValueOption
modules.The existing way of approaching this problem in F# is falling back to match expressions.
Pros and Cons
The advantages of making this adjustment to F# are
The disadvantages of making this adjustment to F# are more functions needed to learn.
Extra information
Estimated cost (XS, S, M, L, XL, XXL): S
Related suggestions:
Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply:
For Readers
If you would like to see this issue implemented, please click the 👍 emoji on this issue. These counts are used to generally order the suggestions by engagement.
The text was updated successfully, but these errors were encountered: