Fluency in Result
#1814
paullatzelsperger
started this conversation in
Ideas
Replies: 3 comments 2 replies
-
Actually love these ideas:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
cool, sounds great! In addition to this, explicit mapping like Result<String> result = getResult();
var voidResult = result.mapTo(Void.class); could also come in handy at times. ad 4: yes, actually quite similar to |
Beta Was this translation helpful? Give feedback.
2 replies
-
created #1823 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
While using the (great)
Result
class, I was wondering whether we could/should add some syntactic sugar to it that allows us to use it in a more fluent way.I do not yet have a comprehensive list, but the following scenarios came to mind:
For me, this really surfaced when dealing with
Result
s of different types, converting one into the other, executing code conditionally, using and mapping Streams, etc.I have not thought about the implementation aspects in great detail yet, rather from a "as a user I want" perspective, but I would be happy to dig into this some more.
Keen to hear peoples' opinions!
Beta Was this translation helpful? Give feedback.
All reactions