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
Add HashMapT salt, which allows creation of salt with Nat.
This allows clients to create custom salted hashmaps.
For backwards compatibility we use
```haskell
-- backwards compatibility
type HashMap = HashMapT DefaultSalt
```
Then modify the functions to be free of salt if they can, for example insert:
```haskell
insert :: forall k v salt . (Eq k, Hashable k) => k -> v -> HashMapT salt k v -> HashMapT salt k v
insert k v m = insert' (hash salt k) k v m
where
salt = natVal (Proxy :: Proxy salt)
```
This allows the default HashMap with backwards compatibility,
but also any other HashMapT
I think this solves the issue with having different salts in
an intersect:
```haskell
intersection :: (Eq k, Hashable k) => HashMapT salt k v -> HashMapT salt k w -> HashMapT salt k v
```
Because salt is the same type variable for all arguments,
it's enforced to be the same.
Then you can also provide a function to resalt if the user ever ends
up with different salts and still wants to do an intersect.
(which results in a reconstruction of the hashmap).
See thread: #319
Fix the defaultHash issues
Be more verbose about default value
Add comma
Fix CI maybe
link to source of magick number
Fix default hash assertion
0 commit comments