Skip to content

Document guarantee that hash (Arg x _) == hash x #242

Open
@josephcsible

Description

In haskell-unordered-containers/unordered-containers#349, I'm proposing to add functions that convert between HashMaps with k as keys and ones with Arg k v as keys, without needing to rehash anything. For this to be safe, it needs to be the case that hash (Arg x _) == hash x. This is indeed the case, but the documentation doesn't currently guarantee this. It only lets us infer the weaker guarantee x1 == x2 -> hash (Arg x1 y1) == hash (Arg x2 y2), which isn't sufficient for this purpose. Can we add the stronger guarantee to the documentation?

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions