vlingo / xoom-common

The VLINGO XOOM platform SDK common tools shared across various projects.
Other
16 stars 10 forks source link

Composable class Outcome<F,S> #5

Closed kmruiz closed 5 years ago

kmruiz commented 5 years ago

This is the signature for Outcome<Failure, Success> so we can verify that the implementation will be as expected.

If is there any improvement or you find that the interface lacks of a method that you would like to have, feel free to ask for it 😄 .

And I would like also to know if we want to have some functional methods that are quite common on those kind of 'monadic' behaviours. I'm thinking on:

And maybe some interop with Java and vlingo:

New Methods

kmruiz commented 5 years ago

So you have two options to handle failures:

VaughnVernon commented 5 years ago

Excellent! I think it would be great to add all of the above discussed method/functions that you recommended. I like the filter(...) but zipWith(...) doesn't speak to me (maybe not others, either). Can you think of a more fluent descriptive name for this? I also like asOptional() and asCompletes() and others. So please just do what you recommend, but maybe with one better name.