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

Add Option#mapTry() #2977

Merged
merged 5 commits into from
Jan 12, 2025
Merged

Add Option#mapTry() #2977

merged 5 commits into from
Jan 12, 2025

Conversation

bvkatwijk
Copy link
Contributor

@bvkatwijk bvkatwijk commented Jan 10, 2025

Add mapTry method to Option, which is a shortcut for .toTry().mapTry:

  • when mapping an optional using a checked method, I find it intuitive that the type changes to a Try, and mapTry methods exist on other types already
  • I initially added it onto Value but this ran into an issue where a method with same name but return value already exists on subtypeFuture

Rebase of #2950

@bvkatwijk bvkatwijk requested a review from pivovarit as a code owner January 10, 2025 09:13
@pivovarit pivovarit changed the title Option maptry Add Option#mapTry() Jan 12, 2025
@pivovarit pivovarit enabled auto-merge (squash) January 12, 2025 11:32
@pivovarit pivovarit merged commit 3797b05 into vavr-io:main Jan 12, 2025
8 checks passed
@pivovarit
Copy link
Member

Looking good, thanks!

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.

2 participants