Stability | experimental |
---|---|
Maintainer | Alexey Khudyakov <alexey.skladnoy@gmail.com> |
Module with algorithms for histogram filling. This is pure wrapper around stateful histograms.
- class HBuilderCl h where
- modifyIn :: (a' -> a) -> h a b -> h a' b
- modifyOut :: (b -> b') -> h a b -> h a b'
- runBuilder :: h a b -> ST s (Accum s a b)
- data HBuilder a b
- builderList :: [HBuilder a b] -> HBuilder a [b]
- builderListWrap :: [HBuilder a b] -> HBuilder a b
- createHistograms :: Monoid b => HBuilder a b -> [a] -> b
- module Data.Histogram.Bin
- mkHist :: (Bin bin, UA val, Num val) => bin -> (Histogram bin val -> b) -> (a -> [BinValue bin]) -> HBuilder a b
- mkHist1 :: (Bin bin, UA val, Num val) => bin -> (Histogram bin val -> b) -> (a -> BinValue bin) -> HBuilder a b
- mkHistWgh :: (Bin bin, UA val, Num val) => bin -> (Histogram bin val -> b) -> (a -> [(BinValue bin, val)]) -> HBuilder a b
- mkHistWgh1 :: (Bin bin, UA val, Num val) => bin -> (Histogram bin val -> b) -> (a -> (BinValue bin, val)) -> HBuilder a b
- mkHistMonoid :: (Bin bin, UA val, Monoid val) => bin -> (Histogram bin val -> b) -> (a -> [(BinValue bin, val)]) -> HBuilder a b
- mkHistMonoid1 :: (Bin bin, UA val, Monoid val) => bin -> (Histogram bin val -> b) -> (a -> (BinValue bin, val)) -> HBuilder a b
- forceInt :: Histogram bin Int -> Histogram bin Int
- forceDouble :: Histogram bin Double -> Histogram bin Double
- forceFloat :: Histogram bin Float -> Histogram bin Float
- data HistBuilder a b
Type classes & wrappers
class HBuilderCl h whereSource
Histogram builder typeclass. Instance of this class contain instructions how to build histograms.
modifyIn :: (a' -> a) -> h a b -> h a' bSource
Convert input type of histogram from a to a'
modifyOut :: (b -> b') -> h a b -> h a b'Source
Convert output of histogram
runBuilder :: h a b -> ST s (Accum s a b)Source
Create stateful histogram from instructions. Histograms could be filled either in the ST monad or with createHistograms
HBuilderCl HistBuilder | |
HBuilderCl HBuilderList | |
HBuilderCl HBuilder |
Abstract histogram builder. All real builders should be wrapper in this type
builderList :: [HBuilder a b] -> HBuilder a [b]Source
Wrap list of histogram builders into HBuilder.
builderListWrap :: [HBuilder a b] -> HBuilder a bSource
Wrap list of histogram builders into HBuilder and do not change return type.
Fill routines
:: Monoid b | |
=> HBuilder a b | Instructions how to fill histograms |
-> [a] | List of data to fill histogram with |
-> b | Result |
Create and fill histogram(s).
Histogram constructors
module Data.Histogram.Bin
:: (Bin bin, UA val, Num val) | |
=> bin | Bin information |
-> (Histogram bin val -> b) | Output function |
-> (a -> [BinValue bin]) | Input function |
-> HBuilder a b |
Create histogram builder which take many items as input. Each item has weight 1. To set type of bin 'force*' function could be used.
:: (Bin bin, UA val, Num val) | |
=> bin | Bin information |
-> (Histogram bin val -> b) | Output function |
-> (a -> BinValue bin) | Input function |
-> HBuilder a b |
Create histogram builder which take single item as input. Each item has weight 1. To set type of bin 'force*' function could be used.
:: (Bin bin, UA val, Num val) | |
=> bin | Bin information |
-> (Histogram bin val -> b) | Output function |
-> (a -> [(BinValue bin, val)]) | Input function |
-> HBuilder a b |
Create histogram with weighted bin. Takes many items at time.
:: (Bin bin, UA val, Num val) | |
=> bin | Bin information |
-> (Histogram bin val -> b) | Output function |
-> (a -> (BinValue bin, val)) | Input function |
-> HBuilder a b |
Create histogram with weighted bin. Takes one item at time.
:: (Bin bin, UA val, Monoid val) | |
=> bin | Bin information |
-> (Histogram bin val -> b) | Output function |
-> (a -> [(BinValue bin, val)]) | Input function |
-> HBuilder a b |
Create histogram with monoidal bins. Takes many items at time.
:: (Bin bin, UA val, Monoid val) | |
=> bin | Bin information |
-> (Histogram bin val -> b) | Output function |
-> (a -> (BinValue bin, val)) | Input function |
-> HBuilder a b |
Create histogram with monoidal bins
forceInt :: Histogram bin Int -> Histogram bin IntSource
Function used to restrict type of histrogram.
forceDouble :: Histogram bin Double -> Histogram bin DoubleSource
Function used to restrict type of histrogram.
forceFloat :: Histogram bin Float -> Histogram bin FloatSource
Function used to restrict type of histrogram.