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 {
hashes :: !(a -> [Hash])
, shift :: {-# UNPACK #-} !Int
, mask :: {-# UNPACK #-} !Int
, bitArray :: {-# UNPACK #-} !(STUArray s Int Hash)
}
instance Show (MBloom s a) where
show mb = "MBloom { " ++ show ((1::Int) `shiftL` shift mb) ++ " bits } "