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 Lwd.update #48

Merged
merged 2 commits into from
Dec 16, 2023
Merged

Add Lwd.update #48

merged 2 commits into from
Dec 16, 2023

Conversation

OlivierNicole
Copy link
Contributor

I found myself defining this function quite quickly when trying Lwd, so I think it could be a useful addition. I do not claim that map_and_set is necessarily the best name.

lib/lwd/lwd.mli Outdated Show resolved Hide resolved
@Julow
Copy link

Julow commented Nov 20, 2023

This is also one of the first utility function I defined.

@let-def
Copy link
Owner

let-def commented Nov 24, 2023

That looks good, thank you.
What do you think about a may_update : ('a -> 'a option) -> 'a var -> unit variant?

@Julow
Copy link

Julow commented Nov 24, 2023

Instead, what do you think of not invalidating the document when the new value is the same as the old one ? (I also think that would be a useful property on Lwd.t values #38)

@OlivierNicole
Copy link
Contributor Author

Why not all of the above?

@let-def let-def merged commit 6305e85 into let-def:master Dec 16, 2023
6 checks passed
@let-def
Copy link
Owner

let-def commented Dec 16, 2023

Thanks, I merged your PR and I will add a may_update function.

@OlivierNicole
Copy link
Contributor Author

Thanks!

@OlivierNicole OlivierNicole deleted the map_and_set branch December 16, 2023 14:02
@OlivierNicole OlivierNicole changed the title Add Lwd.map_and_set Add Lwd.update Dec 16, 2023
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