Skip to content

Commit d403b5a

Browse files
committed
bloomfilter: enable the same warnings as other packages
1 parent 041c594 commit d403b5a

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

bloomfilter/src/Data/BloomFilter/Blocked/BitArray.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import GHC.ST (ST (ST))
4545
-- so that multiple accesses within a single block will use only one cache line.
4646
--
4747
newtype BitArray = BitArray (PrimArray Word64)
48-
deriving (Eq, Show)
48+
deriving stock (Eq, Show)
4949

5050
-- | The number of 512-bit blocks for the given number of bits. This rounds
5151
-- up to the nearest multiple of 512.

bloomfilter/src/Data/BloomFilter/Blocked/Internal.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,17 @@ data Bloom a = Bloom {
153153
, numHashes :: {-# UNPACK #-} !Int
154154
, bitArray :: {-# UNPACK #-} !BitArray
155155
}
156-
deriving Eq
156+
deriving stock Eq
157157
type role Bloom nominal
158158

159159
bloomInvariant :: Bloom a -> Bool
160160
bloomInvariant Bloom { numBlocks, bitArray = BitArray.BitArray pa } =
161-
fromIntegral numBlocks * 8 == sizeofPrimArray pa
161+
numBlocks * 8 == sizeofPrimArray pa
162162

163163
instance Show (Bloom a) where
164164
show mb = "Bloom { " ++ show numBits ++ " bits } "
165165
where
166-
numBits = blocksToBits (fromIntegral (numBlocks mb))
166+
numBits = blocksToBits (numBlocks mb)
167167

168168
instance NFData (Bloom a) where
169169
rnf !_ = ()

bloomfilter/src/Data/BloomFilter/Classic/BitArray.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import GHC.ST (ST (ST))
3131
--
3232
-- This vector's offset and length are multiples of 64
3333
newtype BitArray = BitArray (PrimArray Word64)
34-
deriving (Eq, Show)
34+
deriving stock (Eq, Show)
3535

3636
{-# INLINE unsafeIndex #-}
3737
unsafeIndex :: BitArray -> Int -> Bool

bloomfilter/src/Data/BloomFilter/Classic/Calc.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ data BloomPolicy = BloomPolicy {
4343
policyBits :: !Double,
4444
policyHashes :: !Int
4545
}
46-
deriving Show
46+
deriving stock Show
4747

4848
policyForFPR :: FPR -> BloomPolicy
4949
policyForFPR fpr | fpr <= 0 || fpr >= 1 =
@@ -96,7 +96,7 @@ data BloomSize = BloomSize {
9696
-- | The number of hash functions to use.
9797
sizeHashes :: !Int
9898
}
99-
deriving Show
99+
deriving stock Show
100100

101101
sizeForFPR :: FPR -> NumEntries -> BloomSize
102102
sizeForFPR = sizeForPolicy . policyForFPR

bloomfilter/src/Data/BloomFilter/Classic/Internal.hs

+1-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ data Bloom a = Bloom {
142142
, numHashes :: {-# UNPACK #-} !Int
143143
, bitArray :: {-# UNPACK #-} !BitArray
144144
}
145-
deriving Eq
145+
deriving stock Eq
146146
type role Bloom nominal
147147

148148
bloomInvariant :: Bloom a -> Bool
@@ -276,7 +276,6 @@ word64ToWordShim# x# = x#
276276
--
277277
-- See 'evalHashes'.
278278
data Hashes a = Hashes !Hash !Hash
279-
deriving Show
280279
type role Hashes nominal
281280

282281
instance Prim (Hashes a) where

lsm-tree.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ test-suite xxhash-tests
406406

407407
-- this fork doesn't work on 32bit systems
408408
library bloomfilter
409-
import: language
409+
import: language, warnings
410410
visibility: private
411411
hs-source-dirs: bloomfilter/src
412412
build-depends:
@@ -430,7 +430,7 @@ library bloomfilter
430430
Data.BloomFilter.Classic.Calc
431431
Data.BloomFilter.Classic.Internal
432432

433-
ghc-options: -O2 -Wall
433+
ghc-options: -O2
434434

435435
test-suite bloomfilter-tests
436436
import: language, warnings

0 commit comments

Comments
 (0)