Safe Haskell | None |
---|---|
Language | Haskell2010 |
Types
Synopsis
- bs2i :: ByteString -> Integer
- type BSHashFn = ByteString -> Integer
- data HashMeta = HM {}
- class CountMin sketch where
- increment :: sketch -> ByteString -> sketch
- incrementStr :: sketch -> String -> sketch
- count :: sketch -> ByteString -> Integer
- hashFunctions :: sketch -> [HashMeta]
- totalCount :: sketch -> Integer
- class CountMin sketch => DynamicCountMin sketch where
- addHashMeta :: sketch -> HashMeta -> sketch
- removeHashMeta :: sketch -> HashMeta -> sketch
- class CountMinM m sketch where
- incrementM :: sketch -> ByteString -> m ()
- incrementStrM :: sketch -> String -> m ()
- countM :: sketch -> ByteString -> m Integer
- hashFunctionsM :: sketch -> m [HashMeta]
- totalCountM :: sketch -> m Integer
- class CountMinM m sketch => DynamicCountMinM m sketch where
- addHashMetaM :: sketch -> HashMeta -> m sketch
- removeHashMetaM :: sketch -> HashMeta -> m sketch
Documentation
bs2i :: ByteString -> Integer Source #
Helper function to convert bytestrings to integers (borrowed from https://hackage.haskell.org/package/crypto-api-0.13.3)
type BSHashFn = ByteString -> Integer Source #
Alias for hash functions that are usable in a CountMin sketch
For use internally in CountMinSketch implementations
class CountMin sketch where Source #
Typeclass that captures minimal set of functionality for a CountMin sketch implementation
Minimal complete definition
Methods
increment :: sketch -> ByteString -> sketch Source #
Increment the count of a given key
incrementStr :: sketch -> String -> sketch Source #
Helper for incrementing with a regular string
count :: sketch -> ByteString -> Integer Source #
Get the count of items seen for a given key
hashFunctions :: sketch -> [HashMeta] Source #
Retrieve the hash functions in use
totalCount :: sketch -> Integer Source #
Retrieve the total count of events that this sketch has seen
Instances
CountMin BetterSketch Source # | |
Defined in Lib Methods increment :: BetterSketch -> ByteString -> BetterSketch Source # incrementStr :: BetterSketch -> String -> BetterSketch Source # count :: BetterSketch -> ByteString -> Integer Source # hashFunctions :: BetterSketch -> [HashMeta] Source # totalCount :: BetterSketch -> Integer Source # | |
CountMin NotASketch Source # | |
Defined in Lib Methods increment :: NotASketch -> ByteString -> NotASketch Source # incrementStr :: NotASketch -> String -> NotASketch Source # count :: NotASketch -> ByteString -> Integer Source # hashFunctions :: NotASketch -> [HashMeta] Source # totalCount :: NotASketch -> Integer Source # | |
CountMin Sketch Source # | Implement CountMin for sketch |
class CountMin sketch => DynamicCountMin sketch where Source #
Dynamic sketches allow for re-configuration of hash functions at any time
Methods
addHashMeta :: sketch -> HashMeta -> sketch Source #
Add a hash function for use with sketch
removeHashMeta :: sketch -> HashMeta -> sketch Source #
Remove a hash function for use with the sketch
Instances
DynamicCountMin BetterSketch Source # | |
Defined in Lib Methods addHashMeta :: BetterSketch -> HashMeta -> BetterSketch Source # removeHashMeta :: BetterSketch -> HashMeta -> BetterSketch Source # | |
DynamicCountMin Sketch Source # | |
class CountMinM m sketch where Source #
Maximum performance sketches that reside in some monad m (likely IO)
Minimal complete definition
Methods
incrementM :: sketch -> ByteString -> m () Source #
Increment the count of a given key
incrementStrM :: sketch -> String -> m () Source #
Helper for incrementing with a regular string
countM :: sketch -> ByteString -> m Integer Source #
Get the count of items seen for a given key
hashFunctionsM :: sketch -> m [HashMeta] Source #
Retrieve the hash functions in use
totalCountM :: sketch -> m Integer Source #
Retrieve the total count of events that this sketch has seen
Instances
CountMinM IO BestSketch Source # | |
Defined in Lib Methods incrementM :: BestSketch -> ByteString -> IO () Source # incrementStrM :: BestSketch -> String -> IO () Source # countM :: BestSketch -> ByteString -> IO Integer Source # hashFunctionsM :: BestSketch -> IO [HashMeta] Source # totalCountM :: BestSketch -> IO Integer Source # |
class CountMinM m sketch => DynamicCountMinM m sketch where Source #
Maximum performance dynamic sketches which allow for re-configuration of hash functions at any time
Methods
addHashMetaM :: sketch -> HashMeta -> m sketch Source #
Add a hash function for use with sketch
removeHashMetaM :: sketch -> HashMeta -> m sketch Source #
Remove a hash function for use with the sketch
Instances
DynamicCountMinM IO BestSketch Source # | |
Defined in Lib Methods addHashMetaM :: BestSketch -> HashMeta -> IO BestSketch Source # removeHashMetaM :: BestSketch -> HashMeta -> IO BestSketch Source # |