module Data.BloomFilter.Mutable.Internal
(
Hash
, MBloom(..)
) where
import Data.Array.Base (STUArray)
import Data.Bits (shiftL)
import Data.Word (Word32)
import Prelude hiding (elem, length, notElem,
(/), (*), div, divMod, mod, rem)
type Hash = Word32
data MBloom s a = MB {
forall s a. MBloom s a -> a -> [Hash]
hashes :: !(a -> [Hash])
, forall s a. MBloom s a -> Int
shift :: {-# UNPACK #-} !Int
, forall s a. MBloom s a -> Int
mask :: {-# UNPACK #-} !Int
, forall s a. MBloom s a -> STUArray s Int Hash
bitArray :: {-# UNPACK #-} !(STUArray s Int Hash)
}
instance Show (MBloom s a) where
show :: MBloom s a -> String
show MBloom s a
mb = String
"MBloom { " forall a. [a] -> [a] -> [a]
++ forall a. Show a => a -> String
show ((Int
1::Int) forall a. Bits a => a -> Int -> a
`shiftL` forall s a. MBloom s a -> Int
shift MBloom s a
mb) forall a. [a] -> [a] -> [a]
++ String
" bits } "