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

Make Option's function lazy, deprecate the eager version #60

Merged
merged 4 commits into from
Oct 30, 2023

Conversation

cwmyers
Copy link
Collaborator

@cwmyers cwmyers commented Oct 30, 2023

This change brings Option in line with Either's version see: https://github.com/cashapp/quiver/blob/9862a2af9c6000e12d07bf8fb8d158a21ebd9aa7/lib/src/main/kotlin/app/cash/quiver/extensions/Either.kt#L34

It would be expected behaviour to not have all the alternatives for the or to execute until it is actually needed, especially if there is an expensive side-effect involved.

@Synesso
Copy link
Collaborator

Synesso commented Oct 30, 2023

Remember to update the changelog. & We should remember to bump the minor version for a breaking change.

@cwmyers cwmyers changed the title Breaking change: Make Option's function lazy Make Option's function lazy, deprecate the eager version Oct 30, 2023
@cwmyers cwmyers merged commit 78ae113 into main Oct 30, 2023
2 checks passed
@cwmyers cwmyers deleted the cmyers/2023-10-30-lazy-or branch October 30, 2023 04:02
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

Successfully merging this pull request may close these issues.

3 participants