As the title suggests, I wonder if the alter fn passed to Dict.update would be easier to work with if it were passed a Result rather than [Present v, Missing] value so the various Result functions could be used.
Thoughts? Happy to make a PR if there's agreement!
I agree that we are putting all of our chips into the ergonomics of Result, and it can be represented this way
So yes, using Result v [Missing] would compose better, I'm on board
Sounds fine. Though I'm not sure it will help that much
Generally speaking you will want to handle the found and missing cases separately with a when ... is anyway. But sometimes you may just want to use withDefault. So yeah, sounds reasonable to me.
I think you mean ??, the new sexy version
True
If you want to be super nice updating any uses of Dict.update in other roc repos would be amazing. I kinda doubt it is really used anywhere though. Found one examples: https://github.com/roc-lang/examples/blob/5d4898e5d63aefa96155d2f4f6312b3517bbbf1a/examples/BasicDict/BasicDict.roc#L47
Seems like there are 73 Roc files with Dict.update in them: https://github.com/search?q=Dict.update%20path%3A*.roc&type=code
It would probably be a lot of work to all of them. Maybe ones recently updated, but ignoring out of date ones
I wouldn't worry about anything advent of code or 3rd party. Just core roc-lang/...
https://github.com/search?q=Dict.update+path%3A*.roc+org%3Aroc-lang&type=code
I guess we can toss a note over to #announcements once this lands.
Good call, added a couple PRs to track the change
https://github.com/roc-lang/examples/pull/208
https://github.com/roc-lang/unicode/pull/20
Last updated: Jun 16 2026 at 16:19 UTC