After @Brendan Hansknecht's' recent rewrite of Dict, we don't need Hash & Eq
bounds on the methods anymore. Why not? I imagine we still need to perform these operations on keys. Is it because all types implement them now somehow?
The Dict
type has the requirement. So saying Dict k v
implies that k implements Hash & Eq
. So no need to specify it at all call sites
So I didn't change any requirements. I just removed redundant specifications
I guess the docs here should really show the required abilities: https://www.roc-lang.org/builtins/Dict#Dict
Cause I don't think that is currently specified in any docs.
requirement is right here in the dict definition: https://github.com/roc-lang/roc/blob/f795d0856a8a68747aa7bc975827bd02ff8d4610/crates/compiler/builtins/roc/Dict.roc#L102
Ah makes sense. Thanks
timotree has marked this topic as resolved.
made #6248 about doc generation missing this info
Last updated: Jul 06 2025 at 12:14 UTC