Closed DilumAluthge closed 2 years ago
There's surely a simpler way to implement this. Is there a way to apply map
over just the values of a Dict?
If it's fine to mutate you can use the method:
map!(f, values(dict::AbstractDict))
Modifies dict by transforming each value from val to f(val). Note that the type of dict
cannot be changed: if f(val) is not an instance of the value type of dict then it will be
converted to the value type if possible and otherwise raise an error.
I'm not sure it will simplify much though.
bors merge
Did this fail on the registry prior to the normalisation PR?
It did not.
Okay, I don't think it is 100% effective then since there clearly is a way to compress it further. I'll try see what the difference is (in a couple of days).
Fixes #457
Will likely fail until https://github.com/JuliaRegistries/General/pull/65997 is merged.