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 setIfJust which ignores updates on Nothing #1088

Merged
merged 2 commits into from
Sep 16, 2021
Merged

Conversation

hendi
Copy link
Collaborator

@hendi hendi commented Sep 14, 2021

This adds a function setIfJust which is similar to set but which takes a Mabye value and updates the record if the value is Just, and doesn't change it if it's Nothing.

@s0kil
Copy link
Collaborator

s0kil commented Sep 14, 2021

Does it make more sense to call it setMaybe?

@zacwood9
Copy link
Collaborator

Agreed with setMaybe since it aligns with fromMaybe

@hendi
Copy link
Collaborator Author

hendi commented Sep 14, 2021

Thanks, makes sense! Changed.

Copy link
Member

@mpscholten mpscholten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, good addition 👍

@mpscholten mpscholten merged commit 877ed13 into master Sep 16, 2021
@mpscholten mpscholten deleted the set-if-just branch September 16, 2021 09:58
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.

4 participants