packages feed

bloomfilter 2.0.1.1 → 2.0.1.2

raw patch · 3 files changed

+11/−2 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+#### 2.0.1.2+* Fix Data.BloomFilter.Easy on 32 bit to not incorrectly fail with+  "capacity too large to represent".+ #### 2.0.1.1 * Fix build with GHC 9.2, thanks to Simon Jakobi. * Add CI with GitHub Actions, thanks to Simon Jakobi.
Data/BloomFilter/Easy.hs view
@@ -72,9 +72,14 @@             minimum [((-k) * cap / log (1 - (errRate ** (1 / k))), k)                      | k <- [1..100]]         roundedBits = nextPowerOfTwo (ceiling bits)-    in if roundedBits <= 0 || roundedBits > 0xffffffff+    in if roundedBits <= 0 || maxbitstoolarge roundedBits        then Left  "capacity too large to represent"        else Right (roundedBits, truncate hashes)+  where+    maxbits = 0xffffffff+    -- On 32 bit, maxbits is larger than maxBound :: Int, so wraps around+    -- to a negative number; avoid using it in that case.+    maxbitstoolarge n = if maxbits > 0 then n > maxbits else True  -- | Behaves as 'safeSuggestSizing', but calls 'error' if given -- invalid or out-of-range inputs.
bloomfilter.cabal view
@@ -1,6 +1,6 @@ cabal-version:   3.0 name:            bloomfilter-version:         2.0.1.1+version:         2.0.1.2 license:         BSD-3-Clause license-file:    LICENSE author:          Bryan O'Sullivan <bos@serpentine.com>