diff options
author | Justin Bedo <cu@cua0.org> | 2025-04-28 15:03:03 +1000 |
---|---|---|
committer | Justin Bedo <cu@cua0.org> | 2025-04-28 15:03:03 +1000 |
commit | 4f7a612e15de9e35916fe2e7d395cedb378cafb6 (patch) | |
tree | 240eea19959a12feebdce492c058708cf869ed53 | |
parent | be4be249004af1e7039a29d0228b506139983ea2 (diff) |
tweak hash function
-rw-r--r-- | src/PPL/Internal.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/PPL/Internal.hs b/src/PPL/Internal.hs index a81ba37..a5b3758 100644 --- a/src/PPL/Internal.hs +++ b/src/PPL/Internal.hs @@ -42,13 +42,13 @@ type HashMap k v = H.Dictionary (H.PrimState IO) UM.MVector k UM.MVector v data Hash = Hash {unhash :: Word64} deriving (Eq, Ord, Show) pushbit :: Bool -> Hash -> Hash -pushbit b (Hash state) = Hash $ (0xB2DEEF07CB4ACD43 * fromBool b) `xor` (state `shiftL` 2) `xor` (state `shiftR` 2) +pushbit b (Hash state) = Hash $ (16738720027710993212 * fromBool b) `xor` (state `shiftL` 3) `xor` (state `shiftR` 1) where fromBool True = 1 fromBool False = 0 initHash :: Hash -initHash = Hash 0xE297DA430DB2DF1A +initHash = Hash 6223102867371013753 -- Reimplementation of the LazyPPL monads to avoid some dependencies |