Copyright | (c) Josh Bohde 2015 |
---|---|
License | GPL-3 |
Maintainer | josh@joshbohde.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
A Haskell implementation of HdrHistogram. It allows storing counts of observed values within a range, while maintaining precision to a configurable number of significant digits.
This module captures the common functionality of converting values to
and from Int
indices, regardless of mutability or memory layout.
- data Config lowest highest sig
- type HighLow a b = a <= (b - 1)
- type SigBounds sig = (1 <= sig, sig <= 5)
- class HasConfig s where
- size :: HistogramConfig a -> Int
- indexForValue :: (FiniteBits a, Integral a) => HistogramConfig a -> a -> Int
- data Range a = Range {}
- rangeForIndex :: (Integral a, Bits a) => HistogramConfig a -> Int -> Range a
Config
class HasConfig s where Source #
Typeclass to specify the types which can produce a HistogramConfig
getConfig :: (Integral a, FiniteBits a) => Proxy s -> HistogramConfig a Source #
HistogramConfig
size :: HistogramConfig a -> Int Source #
the total number of elements distinct indices
indexForValue :: (FiniteBits a, Integral a) => HistogramConfig a -> a -> Int Source #
The index for a value
rangeForIndex :: (Integral a, Bits a) => HistogramConfig a -> Int -> Range a Source #
The possible range of values for a given index