You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
Sure. That was a reason of hashable-1.3.0.0 major release, so we can as well document that behavior on the instance of Arg, for others to rely.
I don't see any reason to change the instance ever, and if there would be a reason, the change will be a breaking change, so we'd need to consider the motivation properly.
In haskell-unordered-containers/unordered-containers#349, I'm proposing to add functions that convert between
HashMap
s withk
as keys and ones withArg k v
as keys, without needing to rehash anything. For this to be safe, it needs to be the case thathash (Arg x _) == hash x
. This is indeed the case, but the documentation doesn't currently guarantee this. It only lets us infer the weaker guaranteex1 == 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?The text was updated successfully, but these errors were encountered: