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

Combinators for Either <--> Option #46

Open
vreuter opened this issue Jul 17, 2024 · 1 comment
Open

Combinators for Either <--> Option #46

vreuter opened this issue Jul 17, 2024 · 1 comment

Comments

@vreuter
Copy link

vreuter commented Jul 17, 2024

Hi @vickumar1981 thanks for this excellent project. Would you be open to addition of combinators on Either and Option to flip back-and-forth, analogous to toLeft and toRight on scala.Option and toOption on scala.Either?

@vickumar1981
Copy link
Owner

@vreuter , i think that would be a great feature/functionality to add.

So basically, to the Either subclasses, we can add toOption().

And to the Option subclasses, we can add toRight (not sure how to deal with toLeft but open to ideas).

For anyone's reference: https://scalajobs.com/blog/how-to-convert-option-to-either-in-scala/

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

No branches or pull requests

2 participants