Safe Haskell | None |
---|
Hierarchical Bloom filters
- data Bloom = Bloom !Int !Int !(Vector Word64)
- entries :: Bloom -> Int
- width :: Bloom -> Int
- bloom :: (Foldable f, Hashable a) => Int -> Int -> f a -> Bloom
- modify :: (forall s. MBloom s -> ST s ()) -> Bloom -> Bloom
- insert :: Hashable a => a -> Bloom -> Bloom
- elem :: Hashable a => a -> Bloom -> Bool
- union :: Bloom -> Bloom -> Bloom
- intersection :: Bloom -> Bloom -> Bloom
- freeze :: PrimMonad m => MBloom (PrimState m) -> m Bloom
- thaw :: PrimMonad m => Bloom -> m (MBloom (PrimState m))
- unsafeFreeze :: PrimMonad m => MBloom (PrimState m) -> m Bloom
- unsafeThaw :: PrimMonad m => Bloom -> m (MBloom (PrimState m))
Documentation
Information
The number of bits in our Bloom
filter. Always an integral multiple of 64.
Construction
Modification
modify :: (forall s. MBloom s -> ST s ()) -> Bloom -> BloomSource
Given an action on a mutable Bloom
filter, modify this one.
Testing
elem :: Hashable a => a -> Bloom -> BoolSource
Check if an element is a member of a Bloom
filter.
This may return false positives, but never a false negative.