stdlib
stdlib copied to clipboard
Replace dict.update with new implementation
trafficstars
- rename dict.update to dict.upsert
- deprecate dict.update
- 2.0 let dict.update return Result and Error if no key found
Is there interset in this, then I'd create a PR.
Let's do it!
- Deprecate
dict.updateand introducedict.upsert - Remove
dict.update - Introduce the new
dict.update
Is there still any interest in a change/alter function as in #599?
That's what the new dict.update is to be
@lpil as short as possible:
- https://github.com/gleam-lang/stdlib/issues/599 seems to be about a function that either updates or removes or adds values to a dict
- while my PR https://github.com/gleam-lang/stdlib/pull/610 is a simple change to the old update to return a Result and simplfy the apply function at the same time.
I do not want to steal anyones opportunity here and am happy to do whatever consensus arrises or whatever the core team decides.
I like all three: the new upsert, the new update and the proposed change/alter (last has the highest complexity to use however)