Stability | experimental |
---|---|
Maintainer | Alexey Khudyakov <alexey.skladnoy@gmail.com> |
Immutable histograms.
- data Histogram bin a where
- module Data.Histogram.Bin
- mapHist :: UA b => (a -> b) -> Histogram bin a -> Histogram bin b
- histBin :: Histogram bin a -> bin
- histData :: Histogram bin a -> UArr a
- underflows :: Histogram bin a -> Maybe a
- overflows :: Histogram bin a -> Maybe a
- outOfRange :: Histogram bin a -> Maybe (a, a)
- readHistogram :: (Read bin, Read a, Bin bin, UA a) => String -> Histogram bin a
- asList :: Histogram bin a -> [(BinValue bin, a)]
- asPairVector :: UA (BinValue bin) => Histogram bin a -> (UArr (BinValue bin), UArr a)
- asVectorPairs :: UA (BinValue bin) => Histogram bin a -> UArr (BinValue bin :*: a)
- sliceY :: (Bin bX, Bin bY) => Histogram (Bin2D bX bY) a -> [(BinValue bY, Histogram bX a)]
- sliceX :: (Bin bX, Bin bY) => Histogram (Bin2D bX bY) a -> [(BinValue bX, Histogram bY a)]
Immutable histogram
data Histogram bin a whereSource
Immutable histogram. Histogram consists of binning algorithm, optional number of under and overflows, and data.
module Data.Histogram.Bin
mapHist :: UA b => (a -> b) -> Histogram bin a -> Histogram bin bSource
fmap lookalike. It's not possible to create Functor instance because of UA restriction.
underflows :: Histogram bin a -> Maybe aSource
Number of underflows
outOfRange :: Histogram bin a -> Maybe (a, a)Source
Underflows and overflows
readHistogram :: (Read bin, Read a, Bin bin, UA a) => String -> Histogram bin aSource
Convert String to histogram. Histogram do not have Read instance because of slowness of ReadP
Conversion
asPairVector :: UA (BinValue bin) => Histogram bin a -> (UArr (BinValue bin), UArr a)Source
Convert to pair of vectors
asVectorPairs :: UA (BinValue bin) => Histogram bin a -> UArr (BinValue bin :*: a)Source
Convert to vector of pairs