Skip to content
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

Maybe.switchIfEmpty(Single) method #4544

Closed
mattinger opened this issue Sep 13, 2016 · 2 comments · Fixed by #5582
Closed

Maybe.switchIfEmpty(Single) method #4544

mattinger opened this issue Sep 13, 2016 · 2 comments · Fixed by #5582

Comments

@mattinger
Copy link

It would be nice to see a method like this:

public class Maybe {
public Single switchIfEmpty(Single single);
}

Semantically, if you switchIfEmpty to a Single from a Maybe, then it becomes a Single, as you are guaranteed either an error or a value. It would just make it less verbose than doing this:

maybe.switchIfEmpty(single.toMaybe()).toSingle()

@mattinger
Copy link
Author

done....

@akarnokd
Copy link
Member

I'm closing this issue due to inactivity. If you have further input on the issue, don't hesitate to reopen this issue or post a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants