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

IOr value #2751

Open
etsinko opened this issue Nov 8, 2023 · 4 comments
Open

IOr value #2751

etsinko opened this issue Nov 8, 2023 · 4 comments

Comments

@etsinko
Copy link

etsinko commented Nov 8, 2023

Hello,
I have been using Vavr extensively in my projects and had a need for an IOr value type. I understand that there is no such value type in Vavr and was wondering if Vavr needs it. In my opinion, it would be a nice addition for Vavr.
I have already implemented it and would love to contribute it to the project. Let me know if you are interested in it and I'll create a PR.

@danieldietrich
Copy link
Member

Hi Egor, thank you for your suggestion. Vavr aligns to the Scala standard library, therefore IOr would be a better fit for an extension library (on your side) on top of Vavr.

Just out of curiosity - is your IOr the bitwise Boolean inclusive-OR or the IO reader monad? Nevertheless, it would be an extension to Vavr.

Thanks!

@etsinko
Copy link
Author

etsinko commented Nov 9, 2023

Hi Daniel,
forgot to mention, this is inclusive-or which compliments either (exclusive-or) and it was inspired by Cats IOr from Typelevel. The use case would be similar to Either but in cases when you have non-fatal errors on the left side that you want to collect.
It is ok if you think that IOr wouldn't fit into Vavr because it is not the part of Scala standard library. However, Vavr's Validation is not part of the Scala standard library too but it fits nice in Vavr.

@danieldietrich
Copy link
Member

Hi, thanks for the clarification!
Yes, you are right, Validation is fitting well into Vavr on the one hand but it is not part of the standard library on the other hand. My last efforts focused on simplifying Vavr. It would be good to move Validation out of Vavr, into its own library that builds on top of Vavr, similar like Cats built on top of Scala. IOr could then accompany Validation.

@etsinko
Copy link
Author

etsinko commented Nov 16, 2023

Sounds good!
Let me know if there will be a project that builds on top of Vavr. I'd be happy to contribute.

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