File tree 6 files changed +10
-11
lines changed
bloomfilter/src/Data/BloomFilter
6 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ import GHC.ST (ST (ST))
45
45
-- so that multiple accesses within a single block will use only one cache line.
46
46
--
47
47
newtype BitArray = BitArray (PrimArray Word64 )
48
- deriving (Eq , Show )
48
+ deriving stock (Eq , Show )
49
49
50
50
-- | The number of 512-bit blocks for the given number of bits. This rounds
51
51
-- up to the nearest multiple of 512.
Original file line number Diff line number Diff line change @@ -153,17 +153,17 @@ data Bloom a = Bloom {
153
153
, numHashes :: {-# UNPACK #-} ! Int
154
154
, bitArray :: {-# UNPACK #-} ! BitArray
155
155
}
156
- deriving Eq
156
+ deriving stock Eq
157
157
type role Bloom nominal
158
158
159
159
bloomInvariant :: Bloom a -> Bool
160
160
bloomInvariant Bloom { numBlocks, bitArray = BitArray. BitArray pa } =
161
- fromIntegral numBlocks * 8 == sizeofPrimArray pa
161
+ numBlocks * 8 == sizeofPrimArray pa
162
162
163
163
instance Show (Bloom a ) where
164
164
show mb = " Bloom { " ++ show numBits ++ " bits } "
165
165
where
166
- numBits = blocksToBits (fromIntegral ( numBlocks mb) )
166
+ numBits = blocksToBits (numBlocks mb)
167
167
168
168
instance NFData (Bloom a ) where
169
169
rnf ! _ = ()
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ import GHC.ST (ST (ST))
31
31
--
32
32
-- This vector's offset and length are multiples of 64
33
33
newtype BitArray = BitArray (PrimArray Word64 )
34
- deriving (Eq , Show )
34
+ deriving stock (Eq , Show )
35
35
36
36
{-# INLINE unsafeIndex #-}
37
37
unsafeIndex :: BitArray -> Int -> Bool
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ data BloomPolicy = BloomPolicy {
43
43
policyBits :: ! Double ,
44
44
policyHashes :: ! Int
45
45
}
46
- deriving Show
46
+ deriving stock Show
47
47
48
48
policyForFPR :: FPR -> BloomPolicy
49
49
policyForFPR fpr | fpr <= 0 || fpr >= 1 =
@@ -96,7 +96,7 @@ data BloomSize = BloomSize {
96
96
-- | The number of hash functions to use.
97
97
sizeHashes :: ! Int
98
98
}
99
- deriving Show
99
+ deriving stock Show
100
100
101
101
sizeForFPR :: FPR -> NumEntries -> BloomSize
102
102
sizeForFPR = sizeForPolicy . policyForFPR
Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ data Bloom a = Bloom {
142
142
, numHashes :: {-# UNPACK #-} ! Int
143
143
, bitArray :: {-# UNPACK #-} ! BitArray
144
144
}
145
- deriving Eq
145
+ deriving stock Eq
146
146
type role Bloom nominal
147
147
148
148
bloomInvariant :: Bloom a -> Bool
@@ -276,7 +276,6 @@ word64ToWordShim# x# = x#
276
276
--
277
277
-- See 'evalHashes'.
278
278
data Hashes a = Hashes ! Hash ! Hash
279
- deriving Show
280
279
type role Hashes nominal
281
280
282
281
instance Prim (Hashes a ) where
Original file line number Diff line number Diff line change @@ -406,7 +406,7 @@ test-suite xxhash-tests
406
406
407
407
-- this fork doesn't work on 32bit systems
408
408
library bloomfilter
409
- import : language
409
+ import : language, warnings
410
410
visibility : private
411
411
hs-source-dirs : bloomfilter/src
412
412
build-depends :
@@ -430,7 +430,7 @@ library bloomfilter
430
430
Data.BloomFilter.Classic.Calc
431
431
Data.BloomFilter.Classic.Internal
432
432
433
- ghc-options : -O2 -Wall
433
+ ghc-options : -O2
434
434
435
435
test-suite bloomfilter-tests
436
436
import : language, warnings
You can’t perform that action at this time.
0 commit comments