packages feed

bloomfilter 1.2.6.6 → 1.2.6.7

raw patch · 2 files changed

+9/−13 lines, 2 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Data.BloomFilter.Hash: instance (Hashable a) => Hashable (Maybe a)
- Data.BloomFilter.Hash: instance (Storable a) => Hashable [a]
+ Data.BloomFilter.Hash: instance Hashable a => Hashable (Maybe a)
+ Data.BloomFilter.Hash: instance Storable a => Hashable [a]
- Data.BloomFilter.Easy: easyList :: (Hashable a) => Double -> [a] -> Bloom a
+ Data.BloomFilter.Easy: easyList :: Hashable a => Double -> [a] -> Bloom a
- Data.BloomFilter.Hash: cheapHashes :: (Hashable a) => Int -> a -> [Word32]
+ Data.BloomFilter.Hash: cheapHashes :: Hashable a => Int -> a -> [Word32]
- Data.BloomFilter.Hash: hash32 :: (Hashable a) => a -> Word32
+ Data.BloomFilter.Hash: hash32 :: Hashable a => a -> Word32
- Data.BloomFilter.Hash: hash64 :: (Hashable a) => a -> Word64
+ Data.BloomFilter.Hash: hash64 :: Hashable a => a -> Word64
- Data.BloomFilter.Hash: hashIO32 :: (Hashable a) => a -> Word32 -> IO Word32
+ Data.BloomFilter.Hash: hashIO32 :: Hashable a => a -> Word32 -> IO Word32
- Data.BloomFilter.Hash: hashIO64 :: (Hashable a) => a -> Word64 -> IO Word64
+ Data.BloomFilter.Hash: hashIO64 :: Hashable a => a -> Word64 -> IO Word64
- Data.BloomFilter.Hash: hashList32 :: (Storable a) => [a] -> Word32 -> IO Word32
+ Data.BloomFilter.Hash: hashList32 :: Storable a => [a] -> Word32 -> IO Word32
- Data.BloomFilter.Hash: hashList64 :: (Storable a) => [a] -> Word64 -> IO Word64
+ Data.BloomFilter.Hash: hashList64 :: Storable a => [a] -> Word64 -> IO Word64
- Data.BloomFilter.Hash: hashOne32 :: (Storable a) => a -> Word32 -> IO Word32
+ Data.BloomFilter.Hash: hashOne32 :: Storable a => a -> Word32 -> IO Word32
- Data.BloomFilter.Hash: hashOne64 :: (Storable a) => a -> Word64 -> IO Word64
+ Data.BloomFilter.Hash: hashOne64 :: Storable a => a -> Word64 -> IO Word64
- Data.BloomFilter.Hash: hashSalt32 :: (Hashable a) => Word32 -> a -> Word32
+ Data.BloomFilter.Hash: hashSalt32 :: Hashable a => Word32 -> a -> Word32
- Data.BloomFilter.Hash: hashSalt64 :: (Hashable a) => Word64 -> a -> Word64
+ Data.BloomFilter.Hash: hashSalt64 :: Hashable a => Word64 -> a -> Word64
- Data.BloomFilter.Hash: hashes :: (Hashable a) => Int -> a -> [Word32]
+ Data.BloomFilter.Hash: hashes :: Hashable a => Int -> a -> [Word32]

Files

Data/BloomFilter.hs view
@@ -99,8 +99,6 @@ import Data.BloomFilter.Array (newArray) import Data.BloomFilter.Util (FastShift(..), (:*)(..), nextPowerOfTwo) import Data.Word (Word32)-import qualified Data.ByteString as SB-import qualified Data.ByteString.Lazy as LB  -- Make sure we're not performing any expensive arithmetic operations. import Prelude hiding ((/), (*), div, divMod, mod, rem)@@ -119,7 +117,7 @@  -- | A mutable Bloom filter, for use within the 'ST' monad. data MBloom s a = MB {-      hashMB :: {-# UNPACK #-} !(a -> [Hash])+      hashMB :: !(a -> [Hash])     , shiftMB :: {-# UNPACK #-} !Int     , maskMB :: {-# UNPACK #-} !Int     , bitArrayMB :: {-# UNPACK #-} !(STUArray s Int Hash)@@ -127,7 +125,7 @@  -- | An immutable Bloom filter, suitable for querying from pure code. data Bloom a = B {-      hashB :: {-# UNPACK #-} !(a -> [Hash])+      hashB :: !(a -> [Hash])     , shiftB :: {-# UNPACK #-} !Int     , maskB :: {-# UNPACK #-} !Int     , bitArrayB :: {-# UNPACK #-} !(UArray Int Hash)@@ -243,9 +241,6 @@ -- | Insert a value into a mutable Bloom filter.  Afterwards, a -- membership query for the same value is guaranteed to return @True@. insertMB :: MBloom s a -> a -> ST s ()-{-# SPECIALIZE insertMB :: MBloom s SB.ByteString -> SB.ByteString -> ST s () #-}-{-# SPECIALIZE insertMB :: MBloom s LB.ByteString -> LB.ByteString -> ST s () #-}-{-# SPECIALIZE insertMB :: MBloom s String -> String -> ST s () #-} insertMB mb elt = do   let mu = bitArrayMB mb   forM_ (hashesM mb elt) $ \(word :* bit) -> do@@ -367,14 +362,15 @@ -- --   * If it returns @'Just' (a,b)@, @a@ is added to the filter and --     @b@ is used as a new seed.-unfoldB :: (a -> [Hash])        -- ^ family of hash functions to use-        -> Int                  -- ^ number of bits in filter-        -> (b -> Maybe (a, b))  -- ^ seeding function-        -> b                    -- ^ initial seed+unfoldB :: forall a b. (a -> [Hash]) -- ^ family of hash functions to use+        -> Int                       -- ^ number of bits in filter+        -> (b -> Maybe (a, b))       -- ^ seeding function+        -> b                         -- ^ initial seed         -> Bloom a {-# INLINE unfoldB #-} unfoldB hashes numBits f k = createB hashes numBits (loop k)-  where loop j mb = case f j of+  where loop :: forall s. b -> MBloom s a -> ST s ()+        loop j mb = case f j of                       Just (a, j') -> insertMB mb a >> loop j' mb                       _ -> return () 
bloomfilter.cabal view
@@ -1,5 +1,5 @@ name:            bloomfilter-version:         1.2.6.6+version:         1.2.6.7 license:         BSD3 license-file:    LICENSE author:          Bryan O'Sullivan <bos@serpentine.com>