histogram-fill 0.8.4.1 → 0.8.5.0
raw patch · 11 files changed
+457/−284 lines, 11 filesdep −monad-primitivedep ~basedep ~primitivePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies removed: monad-primitive
Dependency ranges changed: base, primitive
API changes (from Hackage documentation)
- Data.Histogram.Bin: instance [overlap ok] (ConvertBin bx bx', Bin by) => ConvertBin (Bin2D bx by) (Bin2D bx' by)
- Data.Histogram.Bin: instance [overlap ok] (ConvertBin bx bx', ConvertBin by by') => ConvertBin (Bin2D bx by) (Bin2D bx' by')
- Data.Histogram.Bin: instance [overlap ok] (ConvertBin by by', Bin bx) => ConvertBin (Bin2D bx by) (Bin2D bx by')
- Data.Histogram.Bin: instance [overlap ok] ConvertBin BinI BinD
- Data.Histogram.Bin: instance [overlap ok] ConvertBin BinI BinInt
- Data.Histogram.Bin: instance [overlap ok] ConvertBin BinInt BinD
- Data.Histogram.Bin: instance [overlap ok] RealFrac f => ConvertBin BinI (BinF f)
- Data.Histogram.Bin: instance [overlap ok] RealFrac f => ConvertBin BinInt (BinF f)
- Data.Histogram.Bin.Bin2D: binX :: Bin2D binX binY -> !binX
- Data.Histogram.Bin.Bin2D: binY :: Bin2D binX binY -> !binY
- Data.Histogram.Bin.Bin2D: instance (Bin binX, Bin binY) => Bin (Bin2D binX binY)
- Data.Histogram.Bin.Bin2D: instance (BinEq bx, BinEq by) => BinEq (Bin2D bx by)
- Data.Histogram.Bin.Bin2D: instance (Data binX, Data binY) => Data (Bin2D binX binY)
- Data.Histogram.Bin.Bin2D: instance (Eq binX, Eq binY) => Eq (Bin2D binX binY)
- Data.Histogram.Bin.Bin2D: instance (NFData bx, NFData by) => NFData (Bin2D bx by)
- Data.Histogram.Bin.Bin2D: instance (Read bx, Read by) => Read (Bin2D bx by)
- Data.Histogram.Bin.Bin2D: instance (Show bx, Show by) => Show (Bin2D bx by)
- Data.Histogram.Bin.Bin2D: instance Typeable Bin2D
- Data.Histogram.Bin.BinEnum: instance (Enum a, Ord a) => Bin1D (BinEnum a)
- Data.Histogram.Bin.BinEnum: instance (Enum a, Ord a) => IntervalBin (BinEnum a)
- Data.Histogram.Bin.BinEnum: instance (Enum a, Ord a) => SliceableBin (BinEnum a)
- Data.Histogram.Bin.BinEnum: instance Data a => Data (BinEnum a)
- Data.Histogram.Bin.BinEnum: instance Enum a => Bin (BinEnum a)
- Data.Histogram.Bin.BinEnum: instance Enum a => BinEq (BinEnum a)
- Data.Histogram.Bin.BinEnum: instance Eq (BinEnum a)
- Data.Histogram.Bin.BinEnum: instance NFData (BinEnum a)
- Data.Histogram.Bin.BinEnum: instance Read (BinEnum a)
- Data.Histogram.Bin.BinEnum: instance Show (BinEnum a)
- Data.Histogram.Bin.BinEnum: instance Typeable BinEnum
- Data.Histogram.Bin.BinF: instance (Read f, RealFrac f) => Read (BinF f)
- Data.Histogram.Bin.BinF: instance Bin BinD
- Data.Histogram.Bin.BinF: instance Bin1D BinD
- Data.Histogram.Bin.BinF: instance BinEq BinD
- Data.Histogram.Bin.BinF: instance Data BinD
- Data.Histogram.Bin.BinF: instance Data f => Data (BinF f)
- Data.Histogram.Bin.BinF: instance Eq BinD
- Data.Histogram.Bin.BinF: instance Eq f => Eq (BinF f)
- Data.Histogram.Bin.BinF: instance IntervalBin BinD
- Data.Histogram.Bin.BinF: instance MergeableBin BinD
- Data.Histogram.Bin.BinF: instance NFData BinD
- Data.Histogram.Bin.BinF: instance NFData f => NFData (BinF f)
- Data.Histogram.Bin.BinF: instance Read BinD
- Data.Histogram.Bin.BinF: instance RealFloat f => BinEq (BinF f)
- Data.Histogram.Bin.BinF: instance RealFrac f => Bin (BinF f)
- Data.Histogram.Bin.BinF: instance RealFrac f => Bin1D (BinF f)
- Data.Histogram.Bin.BinF: instance RealFrac f => IntervalBin (BinF f)
- Data.Histogram.Bin.BinF: instance RealFrac f => MergeableBin (BinF f)
- Data.Histogram.Bin.BinF: instance RealFrac f => SliceableBin (BinF f)
- Data.Histogram.Bin.BinF: instance RealFrac f => UniformBin (BinF f)
- Data.Histogram.Bin.BinF: instance RealFrac f => VariableBin (BinF f)
- Data.Histogram.Bin.BinF: instance Show BinD
- Data.Histogram.Bin.BinF: instance Show f => Show (BinF f)
- Data.Histogram.Bin.BinF: instance SliceableBin BinD
- Data.Histogram.Bin.BinF: instance Typeable BinD
- Data.Histogram.Bin.BinF: instance Typeable BinF
- Data.Histogram.Bin.BinF: instance UniformBin BinD
- Data.Histogram.Bin.BinF: instance VariableBin BinD
- Data.Histogram.Bin.BinI: instance Bin BinI
- Data.Histogram.Bin.BinI: instance Bin1D BinI
- Data.Histogram.Bin.BinI: instance BinEq BinI
- Data.Histogram.Bin.BinI: instance Data BinI
- Data.Histogram.Bin.BinI: instance Eq BinI
- Data.Histogram.Bin.BinI: instance IntervalBin BinI
- Data.Histogram.Bin.BinI: instance NFData BinI
- Data.Histogram.Bin.BinI: instance Read BinI
- Data.Histogram.Bin.BinI: instance Show BinI
- Data.Histogram.Bin.BinI: instance SliceableBin BinI
- Data.Histogram.Bin.BinI: instance Typeable BinI
- Data.Histogram.Bin.BinI: instance UniformBin BinI
- Data.Histogram.Bin.BinI: instance VariableBin BinI
- Data.Histogram.Bin.BinInt: instance Bin BinInt
- Data.Histogram.Bin.BinInt: instance Bin1D BinInt
- Data.Histogram.Bin.BinInt: instance BinEq BinInt
- Data.Histogram.Bin.BinInt: instance Data BinInt
- Data.Histogram.Bin.BinInt: instance Eq BinInt
- Data.Histogram.Bin.BinInt: instance IntervalBin BinInt
- Data.Histogram.Bin.BinInt: instance MergeableBin BinInt
- Data.Histogram.Bin.BinInt: instance NFData BinInt
- Data.Histogram.Bin.BinInt: instance Read BinInt
- Data.Histogram.Bin.BinInt: instance Show BinInt
- Data.Histogram.Bin.BinInt: instance SliceableBin BinInt
- Data.Histogram.Bin.BinInt: instance Typeable BinInt
- Data.Histogram.Bin.BinInt: instance UniformBin BinInt
- Data.Histogram.Bin.BinInt: instance VariableBin BinInt
- Data.Histogram.Bin.Classes: instance Constructor C1_0CutDirection
- Data.Histogram.Bin.Classes: instance Constructor C1_1CutDirection
- Data.Histogram.Bin.Classes: instance Data CutDirection
- Data.Histogram.Bin.Classes: instance Datatype D1CutDirection
- Data.Histogram.Bin.Classes: instance Generic CutDirection
- Data.Histogram.Bin.Classes: instance Show CutDirection
- Data.Histogram.Bin.Classes: instance Typeable CutDirection
- Data.Histogram.Bin.Extra: instance (Enum a, Enum b) => Enum2D (a, b)
- Data.Histogram.Bin.Extra: instance (Read i, Enum2D i) => Read (BinEnum2D i)
- Data.Histogram.Bin.Extra: instance (Show i, Enum2D i) => Show (BinEnum2D i)
- Data.Histogram.Bin.Extra: instance Bin b => Bin (BinPermute b)
- Data.Histogram.Bin.Extra: instance Data b => Data (BinPermute b)
- Data.Histogram.Bin.Extra: instance Data i => Data (BinEnum2D i)
- Data.Histogram.Bin.Extra: instance Enum2D i => Bin (BinEnum2D i)
- Data.Histogram.Bin.Extra: instance Eq (BinEnum2D i)
- Data.Histogram.Bin.Extra: instance Eq b => Eq (BinPermute b)
- Data.Histogram.Bin.Extra: instance IntervalBin b => IntervalBin (BinPermute b)
- Data.Histogram.Bin.Extra: instance NFData (BinEnum2D i)
- Data.Histogram.Bin.Extra: instance NFData b => NFData (BinPermute b)
- Data.Histogram.Bin.Extra: instance Read BinI => Read (BinPermute BinI)
- Data.Histogram.Bin.Extra: instance Show b => Show (BinPermute b)
- Data.Histogram.Bin.Extra: instance Typeable BinEnum2D
- Data.Histogram.Bin.Extra: instance Typeable BinPermute
- Data.Histogram.Bin.Extra: instance UniformBin b => UniformBin (BinPermute b)
- Data.Histogram.Bin.Extra: instance VariableBin b => VariableBin (BinPermute b)
- Data.Histogram.Bin.LogBinD: instance Bin LogBinD
- Data.Histogram.Bin.LogBinD: instance Bin1D LogBinD
- Data.Histogram.Bin.LogBinD: instance BinEq LogBinD
- Data.Histogram.Bin.LogBinD: instance Data LogBinD
- Data.Histogram.Bin.LogBinD: instance Eq LogBinD
- Data.Histogram.Bin.LogBinD: instance IntervalBin LogBinD
- Data.Histogram.Bin.LogBinD: instance MergeableBin LogBinD
- Data.Histogram.Bin.LogBinD: instance NFData LogBinD
- Data.Histogram.Bin.LogBinD: instance Read LogBinD
- Data.Histogram.Bin.LogBinD: instance Show LogBinD
- Data.Histogram.Bin.LogBinD: instance SliceableBin LogBinD
- Data.Histogram.Bin.LogBinD: instance Typeable LogBinD
- Data.Histogram.Bin.LogBinD: instance VariableBin LogBinD
- Data.Histogram.Bin.MaybeBin: instance Bin bin => Bin (MaybeBin bin)
- Data.Histogram.Bin.MaybeBin: instance BinEq bin => BinEq (MaybeBin bin)
- Data.Histogram.Bin.MaybeBin: instance Eq bin => Eq (MaybeBin bin)
- Data.Histogram.Bin.MaybeBin: instance NFData bin => NFData (MaybeBin bin)
- Data.Histogram.Bin.MaybeBin: instance Read bin => Read (MaybeBin bin)
- Data.Histogram.Bin.MaybeBin: instance Show bin => Show (MaybeBin bin)
- Data.Histogram.Bin.MaybeBin: instance Typeable MaybeBin
- Data.Histogram.Bin.MaybeBin: instance VariableBin bin => VariableBin (MaybeBin bin)
- Data.Histogram.Fill: hbInput :: HBuilderM m a b -> a -> m ()
- Data.Histogram.Fill: hbOutput :: HBuilderM m a b -> m b
- Data.Histogram.Fill: instance (Monad m, Monoid b) => Monoid (HBuilderM m a b)
- Data.Histogram.Fill: instance Applicative (HBuilder a)
- Data.Histogram.Fill: instance Functor (HBuilder a)
- Data.Histogram.Fill: instance HistBuilder HBuilder
- Data.Histogram.Fill: instance Monad m => Applicative (HBuilderM m a)
- Data.Histogram.Fill: instance Monad m => Functor (HBuilderM m a)
- Data.Histogram.Fill: instance Monad m => HistBuilder (HBuilderM m)
- Data.Histogram.Fill: instance Monoid b => Monoid (HBuilder a b)
- Data.Histogram.Generic: instance (Eq bin, Eq a, Eq (v a)) => Eq (Histogram v bin a)
- Data.Histogram.Generic: instance (NFData a, NFData bin, NFData (v a)) => NFData (Histogram v bin a)
- Data.Histogram.Generic: instance (Show a, Show (BinValue bin), Show bin, Bin bin, Vector v a) => Show (Histogram v bin a)
- Data.Histogram.Generic: instance Functor v => Functor (Histogram v bin)
- Data.Histogram.Generic: instance Typeable HistIndex
- Data.Histogram.Generic: instance Typeable Histogram
+ Data.Histogram.Bin: instance (Data.Histogram.Bin.Classes.ConvertBin bx bx', Data.Histogram.Bin.Classes.Bin by) => Data.Histogram.Bin.Classes.ConvertBin (Data.Histogram.Bin.Bin2D.Bin2D bx by) (Data.Histogram.Bin.Bin2D.Bin2D bx' by)
+ Data.Histogram.Bin: instance (Data.Histogram.Bin.Classes.ConvertBin bx bx', Data.Histogram.Bin.Classes.ConvertBin by by') => Data.Histogram.Bin.Classes.ConvertBin (Data.Histogram.Bin.Bin2D.Bin2D bx by) (Data.Histogram.Bin.Bin2D.Bin2D bx' by')
+ Data.Histogram.Bin: instance (Data.Histogram.Bin.Classes.ConvertBin by by', Data.Histogram.Bin.Classes.Bin bx) => Data.Histogram.Bin.Classes.ConvertBin (Data.Histogram.Bin.Bin2D.Bin2D bx by) (Data.Histogram.Bin.Bin2D.Bin2D bx by')
+ Data.Histogram.Bin: instance Data.Histogram.Bin.Classes.ConvertBin Data.Histogram.Bin.BinI.BinI Data.Histogram.Bin.BinF.BinD
+ Data.Histogram.Bin: instance Data.Histogram.Bin.Classes.ConvertBin Data.Histogram.Bin.BinI.BinI Data.Histogram.Bin.BinInt.BinInt
+ Data.Histogram.Bin: instance Data.Histogram.Bin.Classes.ConvertBin Data.Histogram.Bin.BinInt.BinInt Data.Histogram.Bin.BinF.BinD
+ Data.Histogram.Bin: instance GHC.Real.RealFrac f => Data.Histogram.Bin.Classes.ConvertBin Data.Histogram.Bin.BinI.BinI (Data.Histogram.Bin.BinF.BinF f)
+ Data.Histogram.Bin: instance GHC.Real.RealFrac f => Data.Histogram.Bin.Classes.ConvertBin Data.Histogram.Bin.BinInt.BinInt (Data.Histogram.Bin.BinF.BinF f)
+ Data.Histogram.Bin.Bin2D: [binX] :: Bin2D binX binY -> !binX
+ Data.Histogram.Bin.Bin2D: [binY] :: Bin2D binX binY -> !binY
+ Data.Histogram.Bin.Bin2D: instance (Control.DeepSeq.NFData bx, Control.DeepSeq.NFData by) => Control.DeepSeq.NFData (Data.Histogram.Bin.Bin2D.Bin2D bx by)
+ Data.Histogram.Bin.Bin2D: instance (Data.Data.Data binY, Data.Data.Data binX) => Data.Data.Data (Data.Histogram.Bin.Bin2D.Bin2D binX binY)
+ Data.Histogram.Bin.Bin2D: instance (Data.Histogram.Bin.Classes.Bin binX, Data.Histogram.Bin.Classes.Bin binY) => Data.Histogram.Bin.Classes.Bin (Data.Histogram.Bin.Bin2D.Bin2D binX binY)
+ Data.Histogram.Bin.Bin2D: instance (Data.Histogram.Bin.Classes.BinEq bx, Data.Histogram.Bin.Classes.BinEq by) => Data.Histogram.Bin.Classes.BinEq (Data.Histogram.Bin.Bin2D.Bin2D bx by)
+ Data.Histogram.Bin.Bin2D: instance (GHC.Classes.Eq binY, GHC.Classes.Eq binX) => GHC.Classes.Eq (Data.Histogram.Bin.Bin2D.Bin2D binX binY)
+ Data.Histogram.Bin.Bin2D: instance (GHC.Read.Read bx, GHC.Read.Read by) => GHC.Read.Read (Data.Histogram.Bin.Bin2D.Bin2D bx by)
+ Data.Histogram.Bin.Bin2D: instance (GHC.Show.Show bx, GHC.Show.Show by) => GHC.Show.Show (Data.Histogram.Bin.Bin2D.Bin2D bx by)
+ Data.Histogram.Bin.BinEnum: instance (GHC.Enum.Enum a, GHC.Classes.Ord a) => Data.Histogram.Bin.Classes.Bin1D (Data.Histogram.Bin.BinEnum.BinEnum a)
+ Data.Histogram.Bin.BinEnum: instance (GHC.Enum.Enum a, GHC.Classes.Ord a) => Data.Histogram.Bin.Classes.IntervalBin (Data.Histogram.Bin.BinEnum.BinEnum a)
+ Data.Histogram.Bin.BinEnum: instance (GHC.Enum.Enum a, GHC.Classes.Ord a) => Data.Histogram.Bin.Classes.SliceableBin (Data.Histogram.Bin.BinEnum.BinEnum a)
+ Data.Histogram.Bin.BinEnum: instance Control.DeepSeq.NFData (Data.Histogram.Bin.BinEnum.BinEnum a)
+ Data.Histogram.Bin.BinEnum: instance Data.Data.Data a => Data.Data.Data (Data.Histogram.Bin.BinEnum.BinEnum a)
+ Data.Histogram.Bin.BinEnum: instance GHC.Classes.Eq (Data.Histogram.Bin.BinEnum.BinEnum a)
+ Data.Histogram.Bin.BinEnum: instance GHC.Enum.Enum a => Data.Histogram.Bin.Classes.Bin (Data.Histogram.Bin.BinEnum.BinEnum a)
+ Data.Histogram.Bin.BinEnum: instance GHC.Enum.Enum a => Data.Histogram.Bin.Classes.BinEq (Data.Histogram.Bin.BinEnum.BinEnum a)
+ Data.Histogram.Bin.BinEnum: instance GHC.Read.Read (Data.Histogram.Bin.BinEnum.BinEnum a)
+ Data.Histogram.Bin.BinEnum: instance GHC.Show.Show (Data.Histogram.Bin.BinEnum.BinEnum a)
+ Data.Histogram.Bin.BinF: instance Control.DeepSeq.NFData Data.Histogram.Bin.BinF.BinD
+ Data.Histogram.Bin.BinF: instance Control.DeepSeq.NFData f => Control.DeepSeq.NFData (Data.Histogram.Bin.BinF.BinF f)
+ Data.Histogram.Bin.BinF: instance Data.Data.Data Data.Histogram.Bin.BinF.BinD
+ Data.Histogram.Bin.BinF: instance Data.Data.Data f => Data.Data.Data (Data.Histogram.Bin.BinF.BinF f)
+ Data.Histogram.Bin.BinF: instance Data.Histogram.Bin.Classes.Bin Data.Histogram.Bin.BinF.BinD
+ Data.Histogram.Bin.BinF: instance Data.Histogram.Bin.Classes.Bin1D Data.Histogram.Bin.BinF.BinD
+ Data.Histogram.Bin.BinF: instance Data.Histogram.Bin.Classes.BinEq Data.Histogram.Bin.BinF.BinD
+ Data.Histogram.Bin.BinF: instance Data.Histogram.Bin.Classes.IntervalBin Data.Histogram.Bin.BinF.BinD
+ Data.Histogram.Bin.BinF: instance Data.Histogram.Bin.Classes.MergeableBin Data.Histogram.Bin.BinF.BinD
+ Data.Histogram.Bin.BinF: instance Data.Histogram.Bin.Classes.SliceableBin Data.Histogram.Bin.BinF.BinD
+ Data.Histogram.Bin.BinF: instance Data.Histogram.Bin.Classes.UniformBin Data.Histogram.Bin.BinF.BinD
+ Data.Histogram.Bin.BinF: instance Data.Histogram.Bin.Classes.VariableBin Data.Histogram.Bin.BinF.BinD
+ Data.Histogram.Bin.BinF: instance GHC.Classes.Eq Data.Histogram.Bin.BinF.BinD
+ Data.Histogram.Bin.BinF: instance GHC.Classes.Eq f => GHC.Classes.Eq (Data.Histogram.Bin.BinF.BinF f)
+ Data.Histogram.Bin.BinF: instance GHC.Float.RealFloat f => Data.Histogram.Bin.Classes.BinEq (Data.Histogram.Bin.BinF.BinF f)
+ Data.Histogram.Bin.BinF: instance GHC.Read.Read Data.Histogram.Bin.BinF.BinD
+ Data.Histogram.Bin.BinF: instance GHC.Read.Read f => GHC.Read.Read (Data.Histogram.Bin.BinF.BinF f)
+ Data.Histogram.Bin.BinF: instance GHC.Real.RealFrac f => Data.Histogram.Bin.Classes.Bin (Data.Histogram.Bin.BinF.BinF f)
+ Data.Histogram.Bin.BinF: instance GHC.Real.RealFrac f => Data.Histogram.Bin.Classes.Bin1D (Data.Histogram.Bin.BinF.BinF f)
+ Data.Histogram.Bin.BinF: instance GHC.Real.RealFrac f => Data.Histogram.Bin.Classes.IntervalBin (Data.Histogram.Bin.BinF.BinF f)
+ Data.Histogram.Bin.BinF: instance GHC.Real.RealFrac f => Data.Histogram.Bin.Classes.MergeableBin (Data.Histogram.Bin.BinF.BinF f)
+ Data.Histogram.Bin.BinF: instance GHC.Real.RealFrac f => Data.Histogram.Bin.Classes.SliceableBin (Data.Histogram.Bin.BinF.BinF f)
+ Data.Histogram.Bin.BinF: instance GHC.Real.RealFrac f => Data.Histogram.Bin.Classes.UniformBin (Data.Histogram.Bin.BinF.BinF f)
+ Data.Histogram.Bin.BinF: instance GHC.Real.RealFrac f => Data.Histogram.Bin.Classes.VariableBin (Data.Histogram.Bin.BinF.BinF f)
+ Data.Histogram.Bin.BinF: instance GHC.Show.Show Data.Histogram.Bin.BinF.BinD
+ Data.Histogram.Bin.BinF: instance GHC.Show.Show f => GHC.Show.Show (Data.Histogram.Bin.BinF.BinF f)
+ Data.Histogram.Bin.BinI: instance Control.DeepSeq.NFData Data.Histogram.Bin.BinI.BinI
+ Data.Histogram.Bin.BinI: instance Data.Data.Data Data.Histogram.Bin.BinI.BinI
+ Data.Histogram.Bin.BinI: instance Data.Histogram.Bin.Classes.Bin Data.Histogram.Bin.BinI.BinI
+ Data.Histogram.Bin.BinI: instance Data.Histogram.Bin.Classes.Bin1D Data.Histogram.Bin.BinI.BinI
+ Data.Histogram.Bin.BinI: instance Data.Histogram.Bin.Classes.BinEq Data.Histogram.Bin.BinI.BinI
+ Data.Histogram.Bin.BinI: instance Data.Histogram.Bin.Classes.IntervalBin Data.Histogram.Bin.BinI.BinI
+ Data.Histogram.Bin.BinI: instance Data.Histogram.Bin.Classes.SliceableBin Data.Histogram.Bin.BinI.BinI
+ Data.Histogram.Bin.BinI: instance Data.Histogram.Bin.Classes.UniformBin Data.Histogram.Bin.BinI.BinI
+ Data.Histogram.Bin.BinI: instance Data.Histogram.Bin.Classes.VariableBin Data.Histogram.Bin.BinI.BinI
+ Data.Histogram.Bin.BinI: instance GHC.Classes.Eq Data.Histogram.Bin.BinI.BinI
+ Data.Histogram.Bin.BinI: instance GHC.Read.Read Data.Histogram.Bin.BinI.BinI
+ Data.Histogram.Bin.BinI: instance GHC.Show.Show Data.Histogram.Bin.BinI.BinI
+ Data.Histogram.Bin.BinInt: instance Control.DeepSeq.NFData Data.Histogram.Bin.BinInt.BinInt
+ Data.Histogram.Bin.BinInt: instance Data.Data.Data Data.Histogram.Bin.BinInt.BinInt
+ Data.Histogram.Bin.BinInt: instance Data.Histogram.Bin.Classes.Bin Data.Histogram.Bin.BinInt.BinInt
+ Data.Histogram.Bin.BinInt: instance Data.Histogram.Bin.Classes.Bin1D Data.Histogram.Bin.BinInt.BinInt
+ Data.Histogram.Bin.BinInt: instance Data.Histogram.Bin.Classes.BinEq Data.Histogram.Bin.BinInt.BinInt
+ Data.Histogram.Bin.BinInt: instance Data.Histogram.Bin.Classes.IntervalBin Data.Histogram.Bin.BinInt.BinInt
+ Data.Histogram.Bin.BinInt: instance Data.Histogram.Bin.Classes.MergeableBin Data.Histogram.Bin.BinInt.BinInt
+ Data.Histogram.Bin.BinInt: instance Data.Histogram.Bin.Classes.SliceableBin Data.Histogram.Bin.BinInt.BinInt
+ Data.Histogram.Bin.BinInt: instance Data.Histogram.Bin.Classes.UniformBin Data.Histogram.Bin.BinInt.BinInt
+ Data.Histogram.Bin.BinInt: instance Data.Histogram.Bin.Classes.VariableBin Data.Histogram.Bin.BinInt.BinInt
+ Data.Histogram.Bin.BinInt: instance GHC.Classes.Eq Data.Histogram.Bin.BinInt.BinInt
+ Data.Histogram.Bin.BinInt: instance GHC.Read.Read Data.Histogram.Bin.BinInt.BinInt
+ Data.Histogram.Bin.BinInt: instance GHC.Show.Show Data.Histogram.Bin.BinInt.BinInt
+ Data.Histogram.Bin.BinVar: BinVarG :: v a -> BinVarG v a
+ Data.Histogram.Bin.BinVar: [_cuts] :: BinVarG v a -> v a
+ Data.Histogram.Bin.BinVar: addCut :: (Vector v a, Ord a) => BinVarG v a -> a -> BinVarG v a
+ Data.Histogram.Bin.BinVar: binVar :: (Vector v a, Vector v Bool, Ord a) => v a -> BinVarG v a
+ Data.Histogram.Bin.BinVar: cuts :: BinVarG v a -> v a
+ Data.Histogram.Bin.BinVar: deleteCut :: (Vector v a, Ord a, Fractional a) => BinVarG v a -> Int -> BinVarG v a
+ Data.Histogram.Bin.BinVar: instance (Data.Histogram.Bin.Classes.Bin1D b, Data.Vector.Generic.Base.Vector v (Data.Histogram.Bin.Classes.BinValue b), Data.Vector.Generic.Base.Vector v GHC.Types.Bool, a ~ Data.Histogram.Bin.Classes.BinValue b, GHC.Real.Fractional a) => Data.Histogram.Bin.Classes.ConvertBin b (Data.Histogram.Bin.BinVar.BinVarG v a)
+ Data.Histogram.Bin.BinVar: instance (Data.Vector.Generic.Base.Vector v a, Data.Vector.Generic.Base.Vector v GHC.Types.Bool, GHC.Classes.Ord a, GHC.Real.Fractional a) => Data.Histogram.Bin.Classes.BinEq (Data.Histogram.Bin.BinVar.BinVarG v a)
+ Data.Histogram.Bin.BinVar: instance (Data.Vector.Generic.Base.Vector v a, Data.Vector.Generic.Base.Vector v GHC.Types.Bool, GHC.Read.Read a, GHC.Classes.Ord a) => GHC.Read.Read (Data.Histogram.Bin.BinVar.BinVarG v a)
+ Data.Histogram.Bin.BinVar: instance (Data.Vector.Generic.Base.Vector v a, GHC.Classes.Ord a, GHC.Real.Fractional a) => Data.Histogram.Bin.Classes.Bin (Data.Histogram.Bin.BinVar.BinVarG v a)
+ Data.Histogram.Bin.BinVar: instance (Data.Vector.Generic.Base.Vector v a, GHC.Classes.Ord a, GHC.Real.Fractional a) => Data.Histogram.Bin.Classes.Bin1D (Data.Histogram.Bin.BinVar.BinVarG v a)
+ Data.Histogram.Bin.BinVar: instance (Data.Vector.Generic.Base.Vector v a, GHC.Classes.Ord a, GHC.Real.Fractional a) => Data.Histogram.Bin.Classes.IntervalBin (Data.Histogram.Bin.BinVar.BinVarG v a)
+ Data.Histogram.Bin.BinVar: instance (Data.Vector.Generic.Base.Vector v a, GHC.Classes.Ord a, GHC.Real.Fractional a) => Data.Histogram.Bin.Classes.SliceableBin (Data.Histogram.Bin.BinVar.BinVarG v a)
+ Data.Histogram.Bin.BinVar: instance (Data.Vector.Generic.Base.Vector v a, GHC.Classes.Ord a, GHC.Real.Fractional a) => Data.Histogram.Bin.Classes.VariableBin (Data.Histogram.Bin.BinVar.BinVarG v a)
+ Data.Histogram.Bin.BinVar: instance (Data.Vector.Generic.Base.Vector v a, GHC.Show.Show a) => GHC.Show.Show (Data.Histogram.Bin.BinVar.BinVarG v a)
+ Data.Histogram.Bin.BinVar: instance Control.DeepSeq.NFData (v a) => Control.DeepSeq.NFData (Data.Histogram.Bin.BinVar.BinVarG v a)
+ Data.Histogram.Bin.BinVar: instance GHC.Classes.Eq (v a) => GHC.Classes.Eq (Data.Histogram.Bin.BinVar.BinVarG v a)
+ Data.Histogram.Bin.BinVar: newtype BinVarG v a
+ Data.Histogram.Bin.BinVar: type BinVar = BinVarG Vector
+ Data.Histogram.Bin.BinVar: unsafeBinVar :: v a -> BinVarG v a
+ Data.Histogram.Bin.Classes: instance Data.Data.Data Data.Histogram.Bin.Classes.CutDirection
+ Data.Histogram.Bin.Classes: instance GHC.Generics.Generic Data.Histogram.Bin.Classes.CutDirection
+ Data.Histogram.Bin.Classes: instance GHC.Show.Show Data.Histogram.Bin.Classes.CutDirection
+ Data.Histogram.Bin.Classes: type family BinValue b;
+ Data.Histogram.Bin.Classes: }
+ Data.Histogram.Bin.Extra: instance (GHC.Enum.Enum a, GHC.Enum.Enum b) => Data.Histogram.Bin.Extra.Enum2D (a, b)
+ Data.Histogram.Bin.Extra: instance (GHC.Read.Read i, Data.Histogram.Bin.Extra.Enum2D i) => GHC.Read.Read (Data.Histogram.Bin.Extra.BinEnum2D i)
+ Data.Histogram.Bin.Extra: instance (GHC.Show.Show i, Data.Histogram.Bin.Extra.Enum2D i) => GHC.Show.Show (Data.Histogram.Bin.Extra.BinEnum2D i)
+ Data.Histogram.Bin.Extra: instance Control.DeepSeq.NFData (Data.Histogram.Bin.Extra.BinEnum2D i)
+ Data.Histogram.Bin.Extra: instance Control.DeepSeq.NFData b => Control.DeepSeq.NFData (Data.Histogram.Bin.Extra.BinPermute b)
+ Data.Histogram.Bin.Extra: instance Data.Data.Data b => Data.Data.Data (Data.Histogram.Bin.Extra.BinPermute b)
+ Data.Histogram.Bin.Extra: instance Data.Data.Data i => Data.Data.Data (Data.Histogram.Bin.Extra.BinEnum2D i)
+ Data.Histogram.Bin.Extra: instance Data.Histogram.Bin.Classes.Bin b => Data.Histogram.Bin.Classes.Bin (Data.Histogram.Bin.Extra.BinPermute b)
+ Data.Histogram.Bin.Extra: instance Data.Histogram.Bin.Classes.IntervalBin b => Data.Histogram.Bin.Classes.IntervalBin (Data.Histogram.Bin.Extra.BinPermute b)
+ Data.Histogram.Bin.Extra: instance Data.Histogram.Bin.Classes.UniformBin b => Data.Histogram.Bin.Classes.UniformBin (Data.Histogram.Bin.Extra.BinPermute b)
+ Data.Histogram.Bin.Extra: instance Data.Histogram.Bin.Classes.VariableBin b => Data.Histogram.Bin.Classes.VariableBin (Data.Histogram.Bin.Extra.BinPermute b)
+ Data.Histogram.Bin.Extra: instance Data.Histogram.Bin.Extra.Enum2D i => Data.Histogram.Bin.Classes.Bin (Data.Histogram.Bin.Extra.BinEnum2D i)
+ Data.Histogram.Bin.Extra: instance GHC.Classes.Eq (Data.Histogram.Bin.Extra.BinEnum2D i)
+ Data.Histogram.Bin.Extra: instance GHC.Classes.Eq b => GHC.Classes.Eq (Data.Histogram.Bin.Extra.BinPermute b)
+ Data.Histogram.Bin.Extra: instance GHC.Read.Read Data.Histogram.Bin.BinI.BinI => GHC.Read.Read (Data.Histogram.Bin.Extra.BinPermute Data.Histogram.Bin.BinI.BinI)
+ Data.Histogram.Bin.Extra: instance GHC.Show.Show b => GHC.Show.Show (Data.Histogram.Bin.Extra.BinPermute b)
+ Data.Histogram.Bin.LogBinD: instance Control.DeepSeq.NFData Data.Histogram.Bin.LogBinD.LogBinD
+ Data.Histogram.Bin.LogBinD: instance Data.Data.Data Data.Histogram.Bin.LogBinD.LogBinD
+ Data.Histogram.Bin.LogBinD: instance Data.Histogram.Bin.Classes.Bin Data.Histogram.Bin.LogBinD.LogBinD
+ Data.Histogram.Bin.LogBinD: instance Data.Histogram.Bin.Classes.Bin1D Data.Histogram.Bin.LogBinD.LogBinD
+ Data.Histogram.Bin.LogBinD: instance Data.Histogram.Bin.Classes.BinEq Data.Histogram.Bin.LogBinD.LogBinD
+ Data.Histogram.Bin.LogBinD: instance Data.Histogram.Bin.Classes.IntervalBin Data.Histogram.Bin.LogBinD.LogBinD
+ Data.Histogram.Bin.LogBinD: instance Data.Histogram.Bin.Classes.MergeableBin Data.Histogram.Bin.LogBinD.LogBinD
+ Data.Histogram.Bin.LogBinD: instance Data.Histogram.Bin.Classes.SliceableBin Data.Histogram.Bin.LogBinD.LogBinD
+ Data.Histogram.Bin.LogBinD: instance Data.Histogram.Bin.Classes.VariableBin Data.Histogram.Bin.LogBinD.LogBinD
+ Data.Histogram.Bin.LogBinD: instance GHC.Classes.Eq Data.Histogram.Bin.LogBinD.LogBinD
+ Data.Histogram.Bin.LogBinD: instance GHC.Read.Read Data.Histogram.Bin.LogBinD.LogBinD
+ Data.Histogram.Bin.LogBinD: instance GHC.Show.Show Data.Histogram.Bin.LogBinD.LogBinD
+ Data.Histogram.Bin.MaybeBin: instance Control.DeepSeq.NFData bin => Control.DeepSeq.NFData (Data.Histogram.Bin.MaybeBin.MaybeBin bin)
+ Data.Histogram.Bin.MaybeBin: instance Data.Histogram.Bin.Classes.Bin bin => Data.Histogram.Bin.Classes.Bin (Data.Histogram.Bin.MaybeBin.MaybeBin bin)
+ Data.Histogram.Bin.MaybeBin: instance Data.Histogram.Bin.Classes.BinEq bin => Data.Histogram.Bin.Classes.BinEq (Data.Histogram.Bin.MaybeBin.MaybeBin bin)
+ Data.Histogram.Bin.MaybeBin: instance Data.Histogram.Bin.Classes.VariableBin bin => Data.Histogram.Bin.Classes.VariableBin (Data.Histogram.Bin.MaybeBin.MaybeBin bin)
+ Data.Histogram.Bin.MaybeBin: instance GHC.Classes.Eq bin => GHC.Classes.Eq (Data.Histogram.Bin.MaybeBin.MaybeBin bin)
+ Data.Histogram.Bin.MaybeBin: instance GHC.Read.Read bin => GHC.Read.Read (Data.Histogram.Bin.MaybeBin.MaybeBin bin)
+ Data.Histogram.Bin.MaybeBin: instance GHC.Show.Show bin => GHC.Show.Show (Data.Histogram.Bin.MaybeBin.MaybeBin bin)
+ Data.Histogram.Fill: [hbInput] :: HBuilderM m a b -> a -> m ()
+ Data.Histogram.Fill: [hbOutput] :: HBuilderM m a b -> m b
+ Data.Histogram.Fill: infixl 5 <<-$
+ Data.Histogram.Fill: infixr 4 -<<
+ Data.Histogram.Fill: instance (GHC.Base.Monad m, GHC.Base.Monoid b) => GHC.Base.Monoid (Data.Histogram.Fill.HBuilderM m a b)
+ Data.Histogram.Fill: instance Data.Histogram.Fill.HistBuilder Data.Histogram.Fill.HBuilder
+ Data.Histogram.Fill: instance GHC.Base.Applicative (Data.Histogram.Fill.HBuilder a)
+ Data.Histogram.Fill: instance GHC.Base.Functor (Data.Histogram.Fill.HBuilder a)
+ Data.Histogram.Fill: instance GHC.Base.Monad m => Data.Histogram.Fill.HistBuilder (Data.Histogram.Fill.HBuilderM m)
+ Data.Histogram.Fill: instance GHC.Base.Monad m => GHC.Base.Applicative (Data.Histogram.Fill.HBuilderM m a)
+ Data.Histogram.Fill: instance GHC.Base.Monad m => GHC.Base.Functor (Data.Histogram.Fill.HBuilderM m a)
+ Data.Histogram.Fill: instance GHC.Base.Monoid b => GHC.Base.Monoid (Data.Histogram.Fill.HBuilder a b)
+ Data.Histogram.Generic: instance (Control.DeepSeq.NFData a, Control.DeepSeq.NFData bin, Control.DeepSeq.NFData (v a)) => Control.DeepSeq.NFData (Data.Histogram.Generic.Histogram v bin a)
+ Data.Histogram.Generic: instance (GHC.Classes.Eq (v a), GHC.Classes.Eq a, GHC.Classes.Eq bin) => GHC.Classes.Eq (Data.Histogram.Generic.Histogram v bin a)
+ Data.Histogram.Generic: instance (GHC.Show.Show a, GHC.Show.Show (Data.Histogram.Bin.Classes.BinValue bin), GHC.Show.Show bin, Data.Histogram.Bin.Classes.Bin bin, Data.Vector.Generic.Base.Vector v a) => GHC.Show.Show (Data.Histogram.Generic.Histogram v bin a)
+ Data.Histogram.Generic: instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.Histogram.Generic.Overflows a)
+ Data.Histogram.Generic: instance GHC.Base.Applicative Data.Histogram.Generic.Overflows
+ Data.Histogram.Generic: instance GHC.Base.Functor Data.Histogram.Generic.Overflows
+ Data.Histogram.Generic: instance GHC.Base.Functor v => GHC.Base.Functor (Data.Histogram.Generic.Histogram v bin)
+ Data.Histogram.Generic: instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Histogram.Generic.Overflows a)
- Data.Histogram: asVector :: (Bin bin, Unbox a, Unbox (BinValue bin), Unbox (BinValue bin, a)) => Histogram bin a -> Vector (BinValue bin, a)
+ Data.Histogram: asVector :: (Bin bin, Unbox a, Unbox (BinValue bin, a)) => Histogram bin a -> Vector (BinValue bin, a)
- Data.Histogram: foldl :: (Bin bin, Unbox a) => (b -> a -> b) -> b -> Histogram bin a -> b
+ Data.Histogram: foldl :: (Unbox a) => (b -> a -> b) -> b -> Histogram bin a -> b
- Data.Histogram: liftX :: (Bin bX, Bin bY, Bin bX', BinEq bX', Unbox a, Unbox b) => (Histogram bX a -> Histogram bX' b) -> Histogram (Bin2D bX bY) a -> Histogram (Bin2D bX' bY) b
+ Data.Histogram: liftX :: (Bin bX, Bin bY, BinEq bX', Unbox a, Unbox b) => (Histogram bX a -> Histogram bX' b) -> Histogram (Bin2D bX bY) a -> Histogram (Bin2D bX' bY) b
- Data.Histogram: liftY :: (Bin bX, Bin bY, Bin bY', BinEq bY', Unbox a, Unbox b) => (Histogram bY a -> Histogram bY' b) -> Histogram (Bin2D bX bY) a -> Histogram (Bin2D bX bY') b
+ Data.Histogram: liftY :: (Bin bX, Bin bY, BinEq bY', Unbox a, Unbox b) => (Histogram bY a -> Histogram bY' b) -> Histogram (Bin2D bX bY) a -> Histogram (Bin2D bX bY') b
- Data.Histogram: maxBinBy :: (Bin bin, Ord a, Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> BinValue bin
+ Data.Histogram: maxBinBy :: (Bin bin, Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> BinValue bin
- Data.Histogram: maxIndex :: (Bin bin, Ord a, Unbox a) => Histogram bin a -> Int
+ Data.Histogram: maxIndex :: (Ord a, Unbox a) => Histogram bin a -> Int
- Data.Histogram: maxIndexBy :: (Bin bin, Ord a, Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> Int
+ Data.Histogram: maxIndexBy :: (Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> Int
- Data.Histogram: maximum :: (Bin bin, Unbox a, Ord a) => Histogram bin a -> a
+ Data.Histogram: maximum :: (Unbox a, Ord a) => Histogram bin a -> a
- Data.Histogram: maximumBy :: (Bin bin, Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> a
+ Data.Histogram: maximumBy :: (Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> a
- Data.Histogram: minBinBy :: (Bin bin, Ord a, Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> BinValue bin
+ Data.Histogram: minBinBy :: (Bin bin, Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> BinValue bin
- Data.Histogram: minIndex :: (Bin bin, Ord a, Unbox a) => Histogram bin a -> Int
+ Data.Histogram: minIndex :: (Ord a, Unbox a) => Histogram bin a -> Int
- Data.Histogram: minIndexBy :: (Bin bin, Ord a, Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> Int
+ Data.Histogram: minIndexBy :: (Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> Int
- Data.Histogram: minimum :: (Bin bin, Unbox a, Ord a) => Histogram bin a -> a
+ Data.Histogram: minimum :: (Unbox a, Ord a) => Histogram bin a -> a
- Data.Histogram: minimumBy :: (Bin bin, Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> a
+ Data.Histogram: minimumBy :: (Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> a
- Data.Histogram: sum :: (Bin bin, Unbox a, Num a) => Histogram bin a -> a
+ Data.Histogram: sum :: (Unbox a, Num a) => Histogram bin a -> a
- Data.Histogram: zip :: (Bin bin, BinEq bin, Unbox a, Unbox b, Unbox c) => (a -> b -> c) -> Histogram bin a -> Histogram bin b -> Histogram bin c
+ Data.Histogram: zip :: (BinEq bin, Unbox a, Unbox b, Unbox c) => (a -> b -> c) -> Histogram bin a -> Histogram bin b -> Histogram bin c
- Data.Histogram: zipSafe :: (Bin bin, BinEq bin, Unbox a, Unbox b, Unbox c) => (a -> b -> c) -> Histogram bin a -> Histogram bin b -> Maybe (Histogram bin c)
+ Data.Histogram: zipSafe :: (BinEq bin, Unbox a, Unbox b, Unbox c) => (a -> b -> c) -> Histogram bin a -> Histogram bin b -> Maybe (Histogram bin c)
- Data.Histogram.Bin.Bin2D: toIndex2D :: (Bin binX, Bin binY) => Bin2D binX binY -> Int -> (Int, Int)
+ Data.Histogram.Bin.Bin2D: toIndex2D :: (Bin binX) => Bin2D binX binY -> Int -> (Int, Int)
- Data.Histogram.Bin.Classes: class Bin b where type family BinValue b inRange b x = i >= 0 && i < nBins b where i = toIndex b x
+ Data.Histogram.Bin.Classes: class Bin b where type BinValue b inRange b x = i >= 0 && i < nBins b where i = toIndex b x where {
- Data.Histogram.Fill: (<<-$) :: HistBuilder h => h a b -> (h a b -> h a' b) -> h a' b
+ Data.Histogram.Fill: (<<-$) :: h a b -> (h a b -> h a' b) -> h a' b
- Data.Histogram.Fill: feedOne :: Monad m => HBuilderM m a b -> a -> m ()
+ Data.Histogram.Fill: feedOne :: HBuilderM m a b -> a -> m ()
- Data.Histogram.Fill: freezeHBuilderM :: Monad m => HBuilderM m a b -> m b
+ Data.Histogram.Fill: freezeHBuilderM :: HBuilderM m a b -> m b
- Data.Histogram.Fill: mkStatefulBuilder :: Monad m => (a -> m ()) -> m b -> HBuilderM m a b
+ Data.Histogram.Fill: mkStatefulBuilder :: (a -> m ()) -> m b -> HBuilderM m a b
- Data.Histogram.Generic: foldl :: (Bin bin, Vector v a) => (b -> a -> b) -> b -> Histogram v bin a -> b
+ Data.Histogram.Generic: foldl :: (Vector v a) => (b -> a -> b) -> b -> Histogram v bin a -> b
- Data.Histogram.Generic: maxBinBy :: (Bin bin, Ord a, Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> BinValue bin
+ Data.Histogram.Generic: maxBinBy :: (Bin bin, Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> BinValue bin
- Data.Histogram.Generic: maxIndex :: (Bin bin, Ord a, Vector v a) => Histogram v bin a -> Int
+ Data.Histogram.Generic: maxIndex :: (Ord a, Vector v a) => Histogram v bin a -> Int
- Data.Histogram.Generic: maxIndexBy :: (Bin bin, Ord a, Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> Int
+ Data.Histogram.Generic: maxIndexBy :: (Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> Int
- Data.Histogram.Generic: maximum :: (Bin bin, Vector v a, Ord a) => Histogram v bin a -> a
+ Data.Histogram.Generic: maximum :: (Vector v a, Ord a) => Histogram v bin a -> a
- Data.Histogram.Generic: maximumBy :: (Bin bin, Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> a
+ Data.Histogram.Generic: maximumBy :: (Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> a
- Data.Histogram.Generic: minBinBy :: (Bin bin, Ord a, Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> BinValue bin
+ Data.Histogram.Generic: minBinBy :: (Bin bin, Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> BinValue bin
- Data.Histogram.Generic: minIndex :: (Bin bin, Ord a, Vector v a) => Histogram v bin a -> Int
+ Data.Histogram.Generic: minIndex :: (Ord a, Vector v a) => Histogram v bin a -> Int
- Data.Histogram.Generic: minIndexBy :: (Bin bin, Ord a, Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> Int
+ Data.Histogram.Generic: minIndexBy :: (Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> Int
- Data.Histogram.Generic: minimum :: (Bin bin, Vector v a, Ord a) => Histogram v bin a -> a
+ Data.Histogram.Generic: minimum :: (Vector v a, Ord a) => Histogram v bin a -> a
- Data.Histogram.Generic: minimumBy :: (Bin bin, Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> a
+ Data.Histogram.Generic: minimumBy :: (Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> a
- Data.Histogram.Generic: sum :: (Bin bin, Vector v a, Num a) => Histogram v bin a -> a
+ Data.Histogram.Generic: sum :: (Vector v a, Num a) => Histogram v bin a -> a
- Data.Histogram.Generic: zip :: (Bin bin, BinEq bin, Vector v a, Vector v b, Vector v c) => (a -> b -> c) -> Histogram v bin a -> Histogram v bin b -> Histogram v bin c
+ Data.Histogram.Generic: zip :: (BinEq bin, Vector v a, Vector v b, Vector v c) => (a -> b -> c) -> Histogram v bin a -> Histogram v bin b -> Histogram v bin c
- Data.Histogram.Generic: zipSafe :: (Bin bin, BinEq bin, Vector v a, Vector v b, Vector v c) => (a -> b -> c) -> Histogram v bin a -> Histogram v bin b -> Maybe (Histogram v bin c)
+ Data.Histogram.Generic: zipSafe :: (BinEq bin, Vector v a, Vector v b, Vector v c) => (a -> b -> c) -> Histogram v bin a -> Histogram v bin b -> Maybe (Histogram v bin c)
Files
- ChangeLog +0/−94
- ChangeLog.md +101/−0
- Data/Histogram.hs +22/−22
- Data/Histogram/Bin.hs +4/−4
- Data/Histogram/Bin/Bin2D.hs +1/−1
- Data/Histogram/Bin/BinF.hs +1/−1
- Data/Histogram/Bin/BinVar.hs +155/−0
- Data/Histogram/Bin/LogBinD.hs +4/−4
- Data/Histogram/Fill.hs +63/−63
- Data/Histogram/Generic.hs +98/−86
- histogram-fill.cabal +8/−9
− ChangeLog
@@ -1,94 +0,0 @@-Changes in 0.8.4.1-- * All fields of LogDinD are strict and unpacked. This fixes NFData- instance and improves performance---Changes in 0.8.4.0-- * Missing instances for CutDirection added-- * Missing NFData instances for MaybeBin, BinEnum2D, BinPermute-- * Compatibility with deepseq 1.4---Changes in 0.8.3.0-- * Constraints are relaxed from `PrimMonad' to `Monad' wherever possible in- Data.Histogram.Fill module.---Changes in 0.8.2.0-- * Smart constructors for BinF and BinD check that bin number is not- negative.- * Fixed bug in `binInt'- * Fields of `Histogram' data type are strict now.- * Compatibility with GHC 7.8---Changes in 0.8.1.0-- * Constructor of @HBuilderM@ exported.---Changes in 0.8.0.0-- * `toHBuilderM' added and internal definition of `HBuilder' is- changed. It required adding dependency on @monad-primitive@.- * `joinHBuilder' and @treeHBuilder@ are deprecated.---Changes in 0.7.4.0-- * Function for searching for minimum/maximum added.- * @NFData@ instance is fixed.---Changes in 0.7.3.0-- * `mkStatefulBuilder' is added and HBuilder constructor is exposed.- * Indexing operators for immutable histograms are added.---Changes in 0.7.2.0-- * fromMaybeBin added.---Changes in 0.7.1.0-- * breduceX and breduceY are added.---Changes in 0.7.0.0-- * mkFoldBuilder is added to `Data.Histogram.Fill'- * fill functions in `Data.Histogram.ST' are replaced with generic- variant.- * Indexing for immutable histograms is added and special constructor- for first and last bin are added to `HistIndex' data type.- * Functions to calculate sum, minimum and maximum of immutable- histogram are added.---Changes in 0.6.2.0-- * MaybeBin added.- * Helper function for defining Read instances for bins are exposed.- * mapData function is added.- * Slicing histogram do not results in crash if indices are out of- bounds.- * Eq instances for BinF and BinD are added.- * NFData instance for Bin2D is fixed.---Changes in 0.6.1.0-- * Helper function and type synonym for Bin2D---Changes in 0.6.0.1-- * Fixed compilation with GHC 7.4
+ ChangeLog.md view
@@ -0,0 +1,101 @@+Changes in 0.8.5.0++ * BinVar added+ * Redundant constraints on functions removed+ * Histogram data type now stores overflows/underflows as strict data type+ * Support for GHC<7.6 is dropped++Changes in 0.8.4.1++ * All fields of LogDinD are strict and unpacked. This fixes NFData+ instance and improves performance+++Changes in 0.8.4.0++ * Missing instances for CutDirection added++ * Missing NFData instances for MaybeBin, BinEnum2D, BinPermute++ * Compatibility with deepseq 1.4+++Changes in 0.8.3.0++ * Constraints are relaxed from `PrimMonad' to `Monad' wherever possible in+ Data.Histogram.Fill module.+++Changes in 0.8.2.0++ * Smart constructors for BinF and BinD check that bin number is not+ negative.+ * Fixed bug in `binInt'+ * Fields of `Histogram' data type are strict now.+ * Compatibility with GHC 7.8+++Changes in 0.8.1.0++ * Constructor of @HBuilderM@ exported.+++Changes in 0.8.0.0++ * `toHBuilderM' added and internal definition of `HBuilder' is+ changed. It required adding dependency on @monad-primitive@.+ * `joinHBuilder' and @treeHBuilder@ are deprecated.+++Changes in 0.7.4.0++ * Function for searching for minimum/maximum added.+ * @NFData@ instance is fixed.+++Changes in 0.7.3.0++ * `mkStatefulBuilder' is added and HBuilder constructor is exposed.+ * Indexing operators for immutable histograms are added.+++Changes in 0.7.2.0++ * fromMaybeBin added.+++Changes in 0.7.1.0++ * breduceX and breduceY are added.+++Changes in 0.7.0.0++ * mkFoldBuilder is added to `Data.Histogram.Fill'+ * fill functions in `Data.Histogram.ST' are replaced with generic+ variant.+ * Indexing for immutable histograms is added and special constructor+ for first and last bin are added to `HistIndex' data type.+ * Functions to calculate sum, minimum and maximum of immutable+ histogram are added.+++Changes in 0.6.2.0++ * MaybeBin added.+ * Helper function for defining Read instances for bins are exposed.+ * mapData function is added.+ * Slicing histogram do not results in crash if indices are out of+ bounds.+ * Eq instances for BinF and BinD are added.+ * NFData instance for Bin2D is fixed.+++Changes in 0.6.1.0++ * Helper function and type synonym for Bin2D+++Changes in 0.6.0.1++ * Fixed compilation with GHC 7.4
Data/Histogram.hs view
@@ -8,9 +8,9 @@ -- Maintainer : Alexey Khudyakov <alexey.skladnoy@gmail.com> -- Stability : experimental -- --- Immutable histograms. This module export same APi as--- 'Data.Histogram.Generic' but specialzed to unboxed vectors. Refer--- aforementioned module for documentation.+-- Immutable histograms. This module exports the same API as+-- 'Data.Histogram.Generic' but specialized to unboxed vectors. Refer+-- to the aforementioned module for documentation. module Data.Histogram ( -- * Immutable histogram -- * Immutable histograms Histogram@@ -93,8 +93,8 @@ --- | Immutable histogram. Histogram consists of binning algorithm,--- optional number of under and overflows, and data. +-- | Immutable histogram. A histogram consists of a binning algorithm,+-- an optional number of under and overflows, and data. type Histogram bin a = H.Histogram U.Vector bin a histogram :: (Unbox a, Bin bin) => bin -> Vector a -> Histogram bin a@@ -137,7 +137,7 @@ asList :: (Unbox a, Bin bin) => Histogram bin a -> [(BinValue bin, a)] asList = H.asList -asVector :: (Bin bin, Unbox a, Unbox (BinValue bin), Unbox (BinValue bin,a)) +asVector :: (Bin bin, Unbox a, Unbox (BinValue bin,a)) => Histogram bin a -> Vector (BinValue bin, a) asVector = H.asVector @@ -168,11 +168,11 @@ mapData = H.mapData -zip :: (Bin bin, BinEq bin, Unbox a, Unbox b, Unbox c) +zip :: (BinEq bin, Unbox a, Unbox b, Unbox c) => (a -> b -> c) -> Histogram bin a -> Histogram bin b -> Histogram bin c zip = H.zip -zipSafe :: (Bin bin, BinEq bin, Unbox a, Unbox b, Unbox c)+zipSafe :: (BinEq bin, Unbox a, Unbox b, Unbox c) => (a -> b -> c) -> Histogram bin a -> Histogram bin b -> Maybe (Histogram bin c) zipSafe = H.zipSafe @@ -185,52 +185,52 @@ -- Folding ---------------------------------------------------------------- -foldl :: (Bin bin, Unbox a) => (b -> a -> b) -> b -> Histogram bin a -> b+foldl :: (Unbox a) => (b -> a -> b) -> b -> Histogram bin a -> b foldl = H.foldl bfoldl :: (Bin bin, Unbox a) => (b -> BinValue bin -> a -> b) -> b -> Histogram bin a -> b bfoldl = H.bfoldl -sum :: (Bin bin, Unbox a, Num a) => Histogram bin a -> a+sum :: (Unbox a, Num a) => Histogram bin a -> a sum = H.sum -minimum :: (Bin bin, Unbox a, Ord a) => Histogram bin a -> a+minimum :: (Unbox a, Ord a) => Histogram bin a -> a minimum = H.minimum -minimumBy :: (Bin bin, Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> a+minimumBy :: (Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> a minimumBy = H.minimumBy -maximum :: (Bin bin, Unbox a, Ord a) => Histogram bin a -> a+maximum :: (Unbox a, Ord a) => Histogram bin a -> a maximum = H.maximum -maximumBy :: (Bin bin, Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> a+maximumBy :: (Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> a maximumBy = H.maximumBy -minIndex :: (Bin bin, Ord a, Unbox a) => Histogram bin a -> Int+minIndex :: (Ord a, Unbox a) => Histogram bin a -> Int minIndex = H.minIndex -minIndexBy :: (Bin bin, Ord a, Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> Int+minIndexBy :: (Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> Int minIndexBy = H.minIndexBy -maxIndex :: (Bin bin, Ord a, Unbox a) => Histogram bin a -> Int+maxIndex :: (Ord a, Unbox a) => Histogram bin a -> Int maxIndex = H.maxIndex -maxIndexBy :: (Bin bin, Ord a, Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> Int+maxIndexBy :: (Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> Int maxIndexBy = H.maxIndexBy minBin :: (Bin bin, Ord a, Unbox a) => Histogram bin a -> BinValue bin minBin = H.minBin -minBinBy :: (Bin bin, Ord a, Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> BinValue bin+minBinBy :: (Bin bin, Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> BinValue bin minBinBy = H.minBinBy maxBin :: (Bin bin, Ord a, Unbox a) => Histogram bin a -> BinValue bin maxBin = H.maxBin -maxBinBy :: (Bin bin, Ord a, Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> BinValue bin+maxBinBy :: (Bin bin, Unbox a) => (a -> a -> Ordering) -> Histogram bin a -> BinValue bin maxBinBy = H.maxBinBy @@ -317,13 +317,13 @@ -> Histogram bX b breduceY = H.breduceY -liftX :: (Bin bX, Bin bY, Bin bX', BinEq bX', Unbox a, Unbox b)+liftX :: (Bin bX, Bin bY, BinEq bX', Unbox a, Unbox b) => (Histogram bX a -> Histogram bX' b) -> Histogram (Bin2D bX bY) a -> Histogram (Bin2D bX' bY) b liftX = H.liftX -liftY :: (Bin bX, Bin bY, Bin bY', BinEq bY', Unbox a, Unbox b)+liftY :: (Bin bX, Bin bY, BinEq bY', Unbox a, Unbox b) => (Histogram bY a -> Histogram bY' b) -> Histogram (Bin2D bX bY ) a -> Histogram (Bin2D bX bY') b
Data/Histogram/Bin.hs view
@@ -1,7 +1,7 @@--- Requred for Bin2D conversions+-- Required for Bin2D conversions {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverlappingInstances #-}--- Yes I DO want orphans here+-- Yes, I DO want orphans here {-# OPTIONS_GHC -fno-warn-orphans #-} -- | -- Module : Data.Histogram.Bin@@ -10,8 +10,8 @@ -- Maintainer : Alexey Khudyakov <alexey.skladnoy@gmail.com> -- Stability : experimental ----- Binning algorithms. This is mapping from set of interest to integer--- indices and approximate reverse.+-- Binning algorithms. This is a mapping from set of interest to integer+-- indices and an approximate reverse. module Data.Histogram.Bin ( -- * Type classes
Data/Histogram/Bin/Bin2D.hs view
@@ -47,7 +47,7 @@ {-# INLINE nBins #-} -- | Convert index into pair of indices for X and Y axes-toIndex2D :: (Bin binX, Bin binY) => Bin2D binX binY -> Int -> (Int,Int)+toIndex2D :: (Bin binX) => Bin2D binX binY -> Int -> (Int,Int) toIndex2D !b !i = let (iy,ix) = divMod i (nBins $ binX b) in (ix,iy) {-# INLINE toIndex2D #-}
Data/Histogram/Bin/BinF.hs view
@@ -125,7 +125,7 @@ , "# Step = " ++ show step , "# N = " ++ show n ]-instance (Read f, RealFrac f) => Read (BinF f) where+instance (Read f) => Read (BinF f) where readPrec = keyword "BinF" >> liftM3 BinF (value "Base") (value "Step") (value "N") instance NFData f => NFData (BinF f) where
+ Data/Histogram/Bin/BinVar.hs view
@@ -0,0 +1,155 @@+{-# LANGUAGE BangPatterns #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE UndecidableInstances #-}+module Data.Histogram.Bin.BinVar (+ BinVarG(..)+ , BinVar+ , unsafeBinVar+ , binVar+ , cuts+ , deleteCut+ , addCut+ ) where++import Control.DeepSeq (NFData(..))+import Data.Typeable+import Data.Maybe+import qualified Data.Vector.Generic as G+import Data.Vector.Generic (Vector,(!))+import qualified Data.Vector.Unboxed as U+import Text.Read (Read(..))++import Data.Histogram.Bin.Classes+import Data.Histogram.Bin.Read++++-- | Bins of variable size. Bins are defined by a vector of `cuts`+-- marking the boundary between bins. This assumes that the entire+-- range is continuous. There are n+1 cuts for n bins. This also+-- implies that cuts are in ascending order.+newtype BinVarG v a = BinVarG { _cuts :: v a } -- vector of cuts+ deriving (Eq+#if MIN_VERSION_base(4,7,0)+ , Typeable+#endif+ )++-- | Type synonym for @BinVarG@ specialized for unboxed vectors+type BinVar = BinVarG U.Vector++#if !MIN_VERSION_base(4,7,0)+histTyCon :: String -> String -> TyCon+histTyCon = mkTyCon3 "histogram-fill"++instance Typeable1 v => Typeable1 (BinVarG v) where+ typeOf1 b = mkTyConApp (histTyCon "Data.Histogram.Bin.BinVar" "BinVarG")+ [typeOf1 $ cuts b]+#endif++-- | Create variable bins unsafely+unsafeBinVar :: v a -- ^ cuts+ -> BinVarG v a+unsafeBinVar = BinVarG++-- | Create variable bins unsafely+binVar :: (Vector v a, Vector v Bool, Ord a)+ => v a -- ^ cuts+ -> BinVarG v a+binVar c+ | G.length c < 2+ = error "Data.Histogram.Bin.BinVar.binVar': nonpositive number of bins"+ | G.or $ G.zipWith (>=) c (G.tail c)+ = error "Data.Histogram.Bin.BinVar.binVar': cuts not in ascending order"+ | otherwise = BinVarG c++-- | access cuts+cuts :: BinVarG v a -> v a+cuts (BinVarG c) = c++instance (Vector v a, Ord a, Fractional a) => Bin (BinVarG v a) where+ type BinValue (BinVarG v a) = a+ toIndex (BinVarG c) !x = case G.findIndex (>x) c of+ Nothing -> G.length c - 1+ Just i -> case i of+ 0 -> -1+ _ -> i-1++ -- FIXME: We use fractional here but it means that we cannot use it for Int!+ fromIndex (BinVarG c) !i+ | i >= G.length c - 1 =+ error "Data.Histogram.Bin.BinVar.fromIndex: above range"+ | otherwise = ((c ! i) + (c ! (i+1)))/2+ nBins (BinVarG c) = if G.length c < 2 then 0 else G.length c - 1+ {-# INLINE toIndex #-}++instance (Vector v a, Ord a, Fractional a) => IntervalBin (BinVarG v a) where+ binInterval (BinVarG c) i = (c ! i, c ! (i+1))++instance (Vector v a, Ord a, Fractional a) => Bin1D (BinVarG v a) where+ lowerLimit (BinVarG c) = G.head c+ upperLimit (BinVarG c) = G.last c++instance (Vector v a, Ord a, Fractional a) => SliceableBin (BinVarG v a) where+ unsafeSliceBin i j (BinVarG c) = BinVarG (G.drop i $ G.take (j + 2) c)++instance (Vector v a, Ord a, Fractional a) => VariableBin (BinVarG v a) where+ binSizeN (BinVarG c) !i = c ! (i+1) - c ! i++-- | Equality is up to 3e-11 (2/3th of digits)+instance (Vector v a, Vector v Bool, Ord a, Fractional a) => BinEq (BinVarG v a) where+ binEq (BinVarG c) (BinVarG c')+ = (G.length c == G.length c')+ && (G.and (G.zipWith eq c c'))+ where+ eq x y = abs (x - y) < eps * (abs x `max` abs y)+ eps = 3e-11++instance (Vector v a, Show a) => Show (BinVarG v a) where+ show (BinVarG c) = "# BinVar\n# cuts = " ++ show (G.toList c) ++ "\n"++instance (Vector v a, Vector v Bool, Read a, Ord a) => Read (BinVarG v a) where+ readPrec = do keyword "BinVar"+ xs <- value "cuts"+ return $ binVar $ G.fromList xs+++instance (NFData (v a)) => NFData (BinVarG v a) where+ rnf (BinVarG c) =+ rnf c `seq` ()++-- | Delete a cut, which effectively reduces the entire range of the+-- bins (if the cut was the first or last one) or merges two bins+-- (if the cut was in the middle)+deleteCut :: (Vector v a, Ord a, Fractional a)+ => BinVarG v a -- bin+ -> Int -- cut index+ -> BinVarG v a+deleteCut (BinVarG c) !i+ | G.length c <= 2 =+ error "Data.Histogram.Bin.BinVar.deleteCut: deleting cut but 2 or less cuts"+ | otherwise = BinVarG (G.take i c G.++ G.drop (i+1) c)++-- | insert a new cut which effectively extends the range of the bins or splits a bin+addCut :: (Vector v a, Ord a)+ => BinVarG v a -- bin+ -> a -- new cut value+ -> BinVarG v a+addCut (BinVarG c) !x = BinVarG (G.concat [G.take i c, G.singleton x, G.drop i c])+ where+ i = fromMaybe (G.length c) (G.findIndex (> x) c)++instance ( Bin1D b+ , Vector v (BinValue b)+ , Vector v Bool+ , a ~ (BinValue b)+ , Fractional a)+ => ConvertBin b (BinVarG v a) where+ convertBin b+ = binVar+ $ lowerLimit b `G.cons` G.generate (nBins b) (snd . binInterval b)
Data/Histogram/Bin/LogBinD.hs view
@@ -62,10 +62,10 @@ instance Bin LogBinD where type BinValue LogBinD = Double- toIndex !(LogBinD base step _) !x = floorD $ logBase step (x / base)- fromIndex !(LogBinD base step _) !i | i >= 0 = base * step ** (fromIntegral i + 0.5)- | otherwise = -1 / 0- nBins !(LogBinD _ _ n) = n+ toIndex (LogBinD base step _) !x = floorD $ logBase step (x / base)+ fromIndex (LogBinD base step _) !i | i >= 0 = base * step ** (fromIntegral i + 0.5)+ | otherwise = -1 / 0+ nBins (LogBinD _ _ n) = n {-# INLINE toIndex #-} instance IntervalBin LogBinD where
Data/Histogram/Fill.hs view
@@ -66,9 +66,9 @@ import Control.Monad.ST import Control.Monad.Primitive -import Data.PrimRef import Data.Monoid (Monoid(..)) import Data.Vector.Unboxed (Unbox)+import Data.Primitive.MutVar import qualified Data.Vector.Generic as G import qualified Data.Foldable as F import qualified Data.Traversable as F@@ -122,7 +122,7 @@ {-# INLINE (<<?) #-} -- | Apply function which modify builder-(<<-$) :: HistBuilder h => h a b -> (h a b -> h a' b) -> h a' b+(<<-$) :: h a b -> (h a b -> h a' b) -> h a' b h <<-$ f = f h {-# INLINE (<<-$) #-} @@ -131,7 +131,7 @@ (-<<) = modifyOut {-# INLINE (-<<) #-} --- Fixity of operator+-- Fixity of operators infixl 5 <<- infixl 5 <<-| infixl 5 <<?@@ -142,12 +142,12 @@ -- $examples -- -- All examples will make use of operators to create builders. It's--- possible to avoid their use but operators offer clear notation and--- compose nicely in pipeline. Also note that data flows from right to--- left as with '.' operator.+-- possible to avoid their use, but operators offer clear notation and+-- compose nicely in a pipeline. Also note that data flows from right to+-- left as with the '.' operator. ----- First example just counts ints in in [0..4] inclusive range.--- 'fillBuilder' is used to put all values into accumulator.+-- First example just counts ints in the [0..4] inclusive range.+-- 'fillBuilder' is used to put all values into an accumulator. -- -- > ghci> let h = forceInt -<< mkSimple (BinI 0 4) -- > ghci> fillBuilder h [0,0,0,1,1,2,3,4,4,4]@@ -163,33 +163,33 @@ -- > 3 1 -- > 4 3 ----- More involved example only accept even numbers. Filtering could be--- achieved with either 'addCut' or '<<?' operator.+-- More involved example that only accepts even numbers. Filtering could be+-- achieved with either 'addCut' or the '<<?' operator. -- -- > forceInt -<< mkSimple (BinI 0 4) <<? even ----- Although for example above same result could be acheved by--- filtering of input it doesn't work when multiple histograms with+-- Although for example above same result could be achieved by+-- filtering of input, it doesn't work when multiple histograms with -- different cuts are filled simultaneously. ----- Next example illustrate use of applicative interface. Here two--- histograms are filled at the same time. First accept only even--- numbers and second only odd ones. Results are put into the tuple.+-- Next example illustrates the use of an applicative interface. Here+-- two histograms are filled at the same time. First accept only even+-- numbers and second only the odd ones. Results are put into the tuple. -- -- > (,) <$> -- > (forceInt -<< mkSimple (BinI 0 4) <<? even) -- > (forceInt -<< mkSimple (BinI 0 4) <<? odd) -- -- Another approach is to use 'F.sequenceA' to simultaneously fill--- list (or any other 'Travesable'). +-- a list (or any other 'Traversable'). -- -- > Data.Traversable.sequenceA [ -- > forceInt -<< mkSimple (BinI 0 4) <<? even -- > , forceInt -<< mkSimple (BinI 0 4) <<? odd -- > ] ----- If one wants to collect result from many histograms he can take an--- advantage of 'Monoid' instance of 'HBuilder'. Example below+-- If one wants to collect results from many histograms he can take an+-- advantage of the 'Monoid' instance of 'HBuilder'. Example below -- concatenates string outputs of individual histograms. -- -- > mconcat [@@ -202,18 +202,18 @@ -- Monadic builder ---------------------------------------------------------------- --- | Stateful histogram builder. Adding value to builder could be done--- with 'feedOne' and result could be extracted with+-- | Stateful histogram builder. Adding a value to builder could be done+-- with 'feedOne' and the result could be extracted with -- 'freezeHBuilderM'. ----- There are two ways to obtain stateful builder. First and--- recommended is to thaw 'HBuilder' using 'toHBuilderIO' or--- 'toHBuilderST'. Second is to use 'mkStatefulBuilder'.+-- There are two ways to obtain a stateful builder. First and+-- recommended way is to thaw 'HBuilder' using 'toHBuilderIO' or+-- 'toHBuilderST'. Second possibility is to use 'mkStatefulBuilder'. data HBuilderM m a b = HBuilderM { hbInput :: a -> m () , hbOutput :: m b } --- | Builders modified using 'HistBuilder' API will share same buffer.+-- | Builders modified using 'HistBuilder' API will share the same buffer. instance Monad m => HistBuilder (HBuilderM m) where modifyIn f h = h { hbInput = hbInput h . f } addCut f h = h { hbInput = \x -> when (f x) (hbInput h x) }@@ -242,14 +242,14 @@ {-# INLINE mconcat #-} --- | Put one item into histogram-feedOne :: Monad m => HBuilderM m a b -> a -> m ()+-- | Put one item into the histogram+feedOne :: HBuilderM m a b -> a -> m () feedOne = hbInput {-# INLINE feedOne #-} --- | Extract result from histogram builder. It's safe to call this--- function multiple times and mutate builder afterwards.-freezeHBuilderM :: Monad m => HBuilderM m a b -> m b+-- | Extract the result from a histogram builder. It's safe to call+-- this function multiple times, and mutate the builder afterwards.+freezeHBuilderM :: HBuilderM m a b -> m b freezeHBuilderM = hbOutput {-# INLINE freezeHBuilderM #-} @@ -259,21 +259,21 @@ -- Stateless ---------------------------------------------------------------- --- | Wrapper around stateful histogram builder. It is much more--- convenient to work with than 'HBuilderM'.+-- | Wrapper around the stateful histogram builder. It is much more+-- convenient to work with this one than with 'HBuilderM'. newtype HBuilder a b = HBuilder (forall m. PrimMonad m => m (HBuilderM m a b)) --- | Convert builder to stateful builder in primitive monad+-- | Convert the builder to a stateful builder in a primitive monad toHBuilderM :: PrimMonad m => HBuilder a b -> m (HBuilderM m a b) {-# INLINE toHBuilderM #-} toHBuilderM (HBuilder hb) = hb --- | Convert builder to stateful builder in ST monad+-- | Convert the builder to stateful builder in the ST monad toHBuilderST :: HBuilder a b -> ST s (HBuilderM (ST s) a b) {-# INLINE toHBuilderST #-} toHBuilderST = toHBuilderM --- | Convert builder to builder in IO monad+-- | Convert the builder to builder in the IO monad toHBuilderIO :: HBuilder a b -> IO (HBuilderM IO a b) {-# INLINE toHBuilderIO #-} toHBuilderIO = toHBuilderM@@ -304,27 +304,27 @@ ---------------------------------------------------------------- -- | Create builder. Bin content will be incremented by 1 for each--- item put into histogram+-- item put into the histogram mkSimple :: (Bin bin, Unbox val, Num val ) => bin -> HBuilder (BinValue bin) (Histogram bin val) mkSimple = mkSimpleG {-# INLINE mkSimple #-} --- | Create builder. Bin content will incremented by weight supplied--- for each item put into histogram+-- | Create builder. Bin content will be incremented by the weight supplied+-- for each item put into the histogram mkWeighted :: (Bin bin, Unbox val, Num val ) => bin -> HBuilder (BinValue bin,val) (Histogram bin val) mkWeighted = mkWeightedG {-# INLINE mkWeighted #-} --- | Create builder. New value wil be mappended to current content of--- a bin for each item put into histogram+-- | Create builder. New value will be mappended to current content of+-- a bin for each item put into the histogram mkMonoidal :: (Bin bin, Unbox val, Monoid val ) => bin -> HBuilder (BinValue bin,val) (Histogram bin val) mkMonoidal = mkMonoidalG {-# INLINE mkMonoidal #-} --- | Create most generic histogram builder.+-- | Create a most generic histogram builder. mkFoldBuilder :: (Bin bin, Unbox val) => bin -- ^ Binning algorithm -> val -- ^ Initial value@@ -336,7 +336,7 @@ -- | Create builder. Bin content will be incremented by 1 for each--- item put into histogram+-- item put into the histogram mkSimpleG :: (Bin bin, G.Vector v val, Num val ) => bin -> HBuilder (BinValue bin) (H.Histogram v bin val) mkSimpleG bin = HBuilder $ do@@ -346,15 +346,15 @@ } {-# INLINE mkSimpleG #-} --- | Create builder. Bin content will incremented by weight supplied--- for each item put into histogram+-- | Create builder. Bin content will incremented by the weight supplied+-- for each item put into the histogram mkWeightedG :: (Bin bin, G.Vector v val, Num val ) => bin -> HBuilder (BinValue bin,val) (H.Histogram v bin val) mkWeightedG bin = mkFoldBuilderG bin 0 (+) {-# INLINE mkWeightedG #-} --- | Create builder. New value wil be mappended to current content of--- a bin for each item put into histogram+-- | Create builder. New value will be mappended to current content of+-- a bin for each item put into the histogram mkMonoidalG :: (Bin bin, G.Vector v val, Monoid val ) => bin -> HBuilder (BinValue bin,val) (H.Histogram v bin val) mkMonoidalG bin = mkFoldBuilderG bin mempty mappend@@ -376,21 +376,21 @@ -- | Create histogram builder which just does ordinary pure fold. It -- is intended for use when some fold should be performed together--- with histogram filling+-- with histogram filling. mkFolder :: b -> (a -> b -> b) -> HBuilder a b {-# INLINE mkFolder #-} mkFolder a f = HBuilder $ do- ref <- newPrimRef a- return HBuilderM { hbInput = \x -> modifyPrimRef' ref (f x)- , hbOutput = readPrimRef ref+ ref <- newMutVar a+ return HBuilderM { hbInput = \a -> do b <- readMutVar ref+ writeMutVar ref $! f a b+ , hbOutput = readMutVar ref } --- | Create stateful histogram builder. Output function should be safe--- to call multiple times and builder could be modified afterwards.+-- | Create stateful histogram builder. The output function should be safe+-- to call multiple times and the builder could be modified afterwards. -- So functions like @unsafeFreeze@ from @vector@ couldn't be used.-mkStatefulBuilder :: Monad m- => (a -> m ()) -- ^ Add value to accumulator+mkStatefulBuilder :: (a -> m ()) -- ^ Add value to accumulator -> m b -- ^ Extract result from accumulator -> HBuilderM m a b {-# INLINE mkStatefulBuilder #-}@@ -421,14 +421,14 @@ -- $auxillary ----- In some cases builder constructors do not constrain output type--- enough. Output type is still parametric in value type of histogram.--- Functions below are just 'id' function with more restrictive+-- In some cases the builder constructors do not constrain the output type+-- enough. The output type is still parametric in value type of histogram.+-- Functions below are just the 'id' function with a more restrictive -- signature. ----- In example below 'forceInt' used to fix type of histogram to--- 'Histogram BinI Int'. Without it compiler cannot infer type of--- intermediate histogram.+-- In example below 'forceInt' used to fix type of the histogram to+-- 'Histogram BinI Int'. Without it, the compiler cannot infer type of+-- the intermediate histogram. -- -- > show . forceInt -<< mkSimple (BinI 1 10) @@ -447,26 +447,26 @@ -- Deprecated ---------------------------------------------------------------- --- | Join histogram builders in container+-- | Join histogram builders in a container joinHBuilderM :: (F.Traversable f, Monad m) => f (HBuilderM m a b) -> HBuilderM m a (f b) joinHBuilderM = F.sequenceA {-# INLINE joinHBuilderM #-} {-# DEPRECATED joinHBuilderM "Use Data.Traversable.sequenceA instead" #-} --- | Apply functions to builder+-- | Apply functions to the builder treeHBuilderM :: (Monad m, F.Traversable f) => f (HBuilderM m a b -> HBuilderM m a' b') -> HBuilderM m a b -> HBuilderM m a' (f b') treeHBuilderM fs h = F.traverse ($ h) fs {-# INLINE treeHBuilderM #-} {-# DEPRECATED treeHBuilderM "Use Data.Traversable.traverse. treeHBuilderM fs h = F.traverse ($ h) fs" #-} --- | Join hitogram builders in container.+-- | Join histogram builders in a container. joinHBuilder :: F.Traversable f => f (HBuilder a b) -> HBuilder a (f b) joinHBuilder = F.sequenceA {-# INLINE joinHBuilder #-} {-# DEPRECATED joinHBuilder "Use Data.Traversable.sequenceA instead" #-} --- | Apply function to builder+-- | Apply function to a builder treeHBuilder :: F.Traversable f => f (HBuilder a b -> HBuilder a' b') -> HBuilder a b -> HBuilder a' (f b') treeHBuilder fs h = F.traverse ($ h) fs {-# INLINE treeHBuilder #-}
Data/Histogram/Generic.hs view
@@ -1,15 +1,16 @@-{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE CPP #-}+{-# LANGUAGE DeriveFunctor #-}+{-# LANGUAGE FlexibleContexts #-} -- | -- Module : Data.Histogram -- Copyright : Copyright (c) 2009, Alexey Khudyakov <alexey.skladnoy@gmail.com> -- License : BSD3 -- Maintainer : Alexey Khudyakov <alexey.skladnoy@gmail.com> -- Stability : experimental--- --- Generic immutable histograms. -module Data.Histogram.Generic ( +--+-- Generic immutable histograms.+module Data.Histogram.Generic ( -- * Immutable histograms Histogram , module Data.Histogram.Bin@@ -30,7 +31,7 @@ , overflows , outOfRange -- ** Indexing- , HistIndex(..) + , HistIndex(..) , histIndex , at , atV@@ -82,9 +83,8 @@ , liftY ) where -import Control.Applicative ((<$>),(<*>))-import Control.Arrow ((***), (&&&))-import Control.Monad (ap)+import Control.Applicative ((<$>),Applicative(..),liftA2)+import Control.Arrow ((&&&)) import Control.DeepSeq (NFData(..)) import qualified Data.Vector.Generic as G@@ -104,8 +104,8 @@ -- Data type & smart constructors & conversion ---------------------------------------------------------------- --- | Immutable histogram. Histogram consists of binning algorithm,--- optional number of under and overflows, and data. Type parameter+-- | Immutable histogram. A histogram consists of a binning algorithm,+-- an optional number of under- and overflows, and data. Type parameters -- have following meaning: -- -- [@v@] type of vector used to store bin content.@@ -113,31 +113,47 @@ -- [@bin@] binning. It should be instance of 'Bin'. Check that type class description for details. -- -- [@a@] type of bin content.-data Histogram v bin a = Histogram !bin !(Maybe (a,a)) !(v a)+data Histogram v bin a = Histogram !bin !(Overflows a) !(v a) #if MIN_VERSION_base(4,7,0) deriving (Eq, Typeable) #else deriving (Eq) #endif --- | Create histogram from binning algorithm and vector with--- data. Overflows are set to Nothing. +data Overflows a = NoOverflow+ | Overflow !a !a+ deriving (Eq, Typeable, Functor)++instance NFData a => NFData (Overflows a) where+ rnf NoOverflow = ()+ rnf (Overflow u o) = rnf u `seq` rnf o `seq` ()++instance Applicative Overflows where+ pure x = Overflow x x+ Overflow f g <*> Overflow a b = Overflow (f a) (g b)+ _ <*> _ = NoOverflow++-- | Create histogram from binning algorithm and a vector with+-- data. Overflows are set to Nothing. -- -- Number of bins and vector size must match. histogram :: (Vector v a, Bin bin) => bin -> v a -> Histogram v bin a histogram b = histogramUO b Nothing --- | Create histogram from binning algorithm and vector with data. +-- | Create histogram from binning algorithm and vector with data. -- -- Number of bins and vector size must match. histogramUO :: (Vector v a, Bin bin) => bin -> Maybe (a,a) -> v a -> Histogram v bin a-histogramUO b uo v - | nBins b == G.length v = Histogram b uo v+histogramUO b uo v+ | nBins b == G.length v = Histogram b (toOverflow uo) v | otherwise = error "Data.Histogram.Generic.histogramUO: number of bins and vector size doesn't match"+ where+ toOverflow Nothing = NoOverflow+ toOverflow (Just (u,o)) = Overflow u o -- | Convert histogram data to list. asList :: (Vector v a, Bin bin) => Histogram v bin a -> [(BinValue bin, a)]-asList (Histogram bin _ arr) = +asList (Histogram bin _ arr) = Prelude.zip (fromIndex bin <$> [0..]) (G.toList arr) -- | Convert histogram data to vector@@ -149,13 +165,13 @@ ------------------------------------------------------------------- Instances & reading histograms from strings +-- Instances & reading histograms from strings ---------------------------------------------------------------- -- $serialization -- -- 'Show' instance is abused for serialization and produces human--- readable data like that: +-- readable data like that: -- -- > # Histogram -- > # Underflows = 0@@ -175,7 +191,7 @@ -- > 9 89 -- -- It could be deserialize using 'readHistogram' function. 'Read'--- instance coulde provided as well but it turned out to be+-- instance could be provided as well but it turned out to be -- impractically slow. -- -- Serialization with cereal package is provided by histogram-fill-cereal@@ -185,21 +201,15 @@ unlines (fmap showT $ asList h) where showT (x,y) = show x ++ "\t" ++ show y- showUO (Just (u,o)) = "# Underflows = " ++ show u ++ "\n" ++- "# Overflows = " ++ show o ++ "\n"- showUO Nothing = "# Underflows = \n" ++- "# Overflows = \n"+ showUO (Overflow u o) = "# Underflows = " ++ show u ++ "\n" +++ "# Overflows = " ++ show o ++ "\n"+ showUO NoOverflow = "# Underflows = \n" +++ "# Overflows = \n" #if !MIN_VERSION_base(4,7,0)- histTyCon :: String -> String -> TyCon-#if MIN_VERSION_base(4,4,0) histTyCon = mkTyCon3 "histogram-fill"-#else-histTyCon m s = mkTyCon $ m ++ "." ++ s-#endif--- end MIN_VERSION_base(4,4,0) instance Typeable1 v => Typeable2 (Histogram v) where typeOf2 h = mkTyConApp (histTyCon "Data.Histogram.Generic" "Histogram") [typeOf1 $ histData h]@@ -214,22 +224,25 @@ -- | If vector is a functor then histogram is functor as well instance (Functor v) => Functor (Histogram v bin) where- fmap f (Histogram bin uo vec) = Histogram bin (fmap (f *** f) uo) (fmap f vec)+ fmap f (Histogram bin uo vec) = Histogram bin (fmap f uo) (fmap f vec) -- Parse histogram header-histHeader :: (Read bin, Read a, Bin bin, Vector v a) => ReadPrec (v a -> Histogram v bin a)+histHeader :: (Read bin, Read a) => ReadPrec (v a -> Histogram v bin a) histHeader = do keyword "Histogram" u <- maybeValue "Underflows" o <- maybeValue "Overflows" bin <- readPrec- return $ Histogram bin ((,) `fmap` u `ap` o)+ return $ Histogram bin $ case liftA2 (,) u o of+ Nothing -> NoOverflow+ Just (u',o') -> Overflow u' o' --- | Convert String to histogram. Histogram do not have Read instance--- because of slowness of ReadP++-- | Convert a 'String' to a histogram. Histogram does not have a 'Read' instance+-- because of the slowness of ReadP readHistogram :: (Read bin, Read a, Bin bin, Vector v a) => String -> Histogram v bin a-readHistogram str = +readHistogram str = let (h,rest) = case readPrec_to_S histHeader 0 str of [x] -> x _ -> error "Cannot parse histogram header"@@ -256,7 +269,7 @@ -- | Number of underflows underflows :: Histogram v bin a -> Maybe a-underflows h = fst <$> outOfRange h+underflows h = fst <$> outOfRange h -- | Number of overflows overflows :: Histogram v bin a -> Maybe a@@ -264,7 +277,8 @@ -- | Underflows and overflows outOfRange :: Histogram v bin a -> Maybe (a,a)-outOfRange (Histogram _ uo _) = uo+outOfRange (Histogram _ NoOverflow _) = Nothing+outOfRange (Histogram _ (Overflow u o) _) = Just (u,o) @@ -307,37 +321,35 @@ -- | fmap lookalike. It's not possible to create Functor instance -- because of type class context. map :: (Vector v a, Vector v b) => (a -> b) -> Histogram v bin a -> Histogram v bin b-map f (Histogram bin uo a) = - Histogram bin (fmap (f *** f) uo) (G.map f a)+map f (Histogram bin uo a) =+ Histogram bin (fmap f uo) (G.map f a) -- | Map histogram using bin value and content. Overflows and underflows are set to Nothing. bmap :: (Vector v a, Vector v b, Bin bin) => (BinValue bin -> a -> b) -> Histogram v bin a -> Histogram v bin b bmap f (Histogram bin _ vec) =- Histogram bin Nothing $ G.imap (f . fromIndex bin) vec+ Histogram bin NoOverflow $ G.imap (f . fromIndex bin) vec mapData :: (Vector v a, Vector u b, Bin bin) => (v a -> u b) -> Histogram v bin a -> Histogram u bin b mapData f (Histogram bin _ v) | G.length v /= G.length v' = error "Data.Histogram.Generic.Histogram.mapData: vector length changed"- | otherwise = Histogram bin Nothing v'+ | otherwise = Histogram bin NoOverflow v' where v' = f v -- | Zip two histograms elementwise. Bins of histograms must be equal -- otherwise error will be called.-zip :: (Bin bin, BinEq bin, Vector v a, Vector v b, Vector v c) =>+zip :: (BinEq bin, Vector v a, Vector v b, Vector v c) => (a -> b -> c) -> Histogram v bin a -> Histogram v bin b -> Histogram v bin c zip f ha hb = fromMaybe (error msg) $ zipSafe f ha hb where msg = "Data.Histogram.Generic.Histogram.histZip: bins are different" --- | Zip two histogram elementwise. If bins are not equal return `Nothing`-zipSafe :: (Bin bin, BinEq bin, Vector v a, Vector v b, Vector v c) =>+-- | Zip two histograms elementwise. If bins are not equal return `Nothing`+zipSafe :: (BinEq bin, Vector v a, Vector v b, Vector v c) => (a -> b -> c) -> Histogram v bin a -> Histogram v bin b -> Maybe (Histogram v bin c) zipSafe f (Histogram bin uo v) (Histogram bin' uo' v')- | binEq bin bin' = Just $ Histogram bin (f2 <$> uo <*> uo') (G.zipWith f v v')+ | binEq bin bin' = Just $ Histogram bin (f <$> uo <*> uo') (G.zipWith f v v') | otherwise = Nothing- where- f2 (x,x') (y,y') = (f x y, f x' y') -- | Convert between different vector types convert :: (Vector v a, Vector w a)@@ -360,7 +372,7 @@ ---------------------------------------------------------------- -- | Strict fold over bin content in index order. Underflows and overflows are ignored.-foldl :: (Bin bin, Vector v a) => (b -> a -> b) -> b -> Histogram v bin a -> b+foldl :: (Vector v a) => (b -> a -> b) -> b -> Histogram v bin a -> b foldl f x0 (Histogram _ _ vec) = G.foldl' f x0 vec @@ -371,41 +383,41 @@ G.ifoldl' (\acc -> f acc . fromIndex bin) x0 vec -- | Sum contents of all bins-sum :: (Bin bin, Vector v a, Num a) => Histogram v bin a -> a+sum :: (Vector v a, Num a) => Histogram v bin a -> a sum = foldl (+) 0 -- | Minimal bin content.-minimum :: (Bin bin, Vector v a, Ord a) => Histogram v bin a -> a+minimum :: (Vector v a, Ord a) => Histogram v bin a -> a minimum = G.minimum . histData -- | Minimal bin content using custom comparison.-minimumBy :: (Bin bin, Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> a+minimumBy :: (Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> a minimumBy f = G.minimumBy f . histData --- | Maximal bin content-maximum :: (Bin bin, Vector v a, Ord a) => Histogram v bin a -> a+-- | Maximal bin content.+maximum :: (Vector v a, Ord a) => Histogram v bin a -> a maximum = G.maximum . histData -- | Maximal bin content using custom comparison.-maximumBy :: (Bin bin, Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> a+maximumBy :: (Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> a maximumBy f = G.maximumBy f . histData --- | Index of a bin with minimal content-minIndex :: (Bin bin, Ord a, Vector v a) => Histogram v bin a -> Int+-- | Index of a bin with minimal content.+minIndex :: ( Ord a, Vector v a) => Histogram v bin a -> Int minIndex = G.minIndex . histData -- | Index of a bin with minimal content using custom comparison.-minIndexBy :: (Bin bin, Ord a, Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> Int+minIndexBy :: (Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> Int minIndexBy f = G.minIndexBy f . histData --- | Index of a bin with maximal content-maxIndex :: (Bin bin, Ord a, Vector v a) => Histogram v bin a -> Int+-- | Index of a bin with maximal content.+maxIndex :: (Ord a, Vector v a) => Histogram v bin a -> Int maxIndex = G.maxIndex . histData -- | Index of a bin with maximal content using custom comparison.-maxIndexBy :: (Bin bin, Ord a, Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> Int+maxIndexBy :: (Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> Int maxIndexBy f = G.maxIndexBy f . histData @@ -414,15 +426,15 @@ minBin = minBinBy compare -- | Value bin with minimal content using custom comparison.-minBinBy :: (Bin bin, Ord a, Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> BinValue bin+minBinBy :: (Bin bin, Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> BinValue bin minBinBy f h = fromIndex (bins h) $ minIndexBy f h --- | Value of a bin with maximal content+-- | Value of a bin with maximal content. maxBin :: (Bin bin, Ord a, Vector v a) => Histogram v bin a -> BinValue bin maxBin = maxBinBy compare -- | Value of a bin with maximal content using custom comparison.-maxBinBy :: (Bin bin, Ord a, Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> BinValue bin+maxBinBy :: (Bin bin, Vector v a) => (a -> a -> Ordering) -> Histogram v bin a -> BinValue bin maxBinBy f h = fromIndex (bins h) $ maxIndexBy f h @@ -432,10 +444,10 @@ -- Slicing and reducing histograms ---------------------------------------------------------------- --- | Slice histogram. Values/indices specify inclusive+-- | Slice a histogram. Values/indices specify inclusive -- variant. Under/overflows are discarded. If requested value falls--- out of histogram range it will be truncated. Use 'First' or--- 'Last' constructor if you need slice from first or to last bin+-- out of histogram range, it will be truncated. Use 'First' or+-- 'Last' constructor if you need to slice from first or to last bin -- correspondingly. slice :: (SliceableBin bin, Vector v a) => HistIndex bin -- ^ Lower inclusive bound@@ -443,7 +455,7 @@ -> Histogram v bin a -- ^ Histogram to slice -> Histogram v bin a slice a b (Histogram bin _ v) =- Histogram (sliceBin i j bin) Nothing (G.slice i (j - i + 1) v)+ Histogram (sliceBin i j bin) NoOverflow (G.slice i (j - i + 1) v) where i = max 0 $ histIndex bin a j = min n $ histIndex bin b@@ -479,7 +491,7 @@ {-# INLINE rebinWorker #-} rebinWorker dir k f (Histogram bin _ vec) | G.length vec' /= nBins bin' = error "Data.Histogram.Generic.rebin: wrong MergeableBin instance"- | otherwise = Histogram bin' Nothing vec'+ | otherwise = Histogram bin' NoOverflow vec' where bin' = mergeBins dir k bin vec' = G.generate n $ \i -> f (G.slice (off + i*k) k vec)@@ -496,26 +508,26 @@ -- $hist2D -- -- Data in 2D histograms is stored in row major order. This in fact--- dictated by implementation of 'Bin2D'. So indices of bin are--- arranged in following pattern:--- +-- is dictated by the implementation of 'Bin2D'. So indices of the bin are+-- arranged in the following pattern:+-- -- > 0 1 2 3 -- > 4 5 6 7 -- > 8 9 10 11 ----- Function from @AlongX@ family work with histogram slices along X--- axis (as name suggest) which are contigous and therefor are--- generally faster than @AlongY@ family.+-- Functions from @AlongX@ family work with histogram slices along the X+-- axis (as the name suggests) which are contigous, and therefore are+-- generally faster than those from the @AlongY@ family. --- | Get slice of 2D histogram along X axis. This function is faster--- than 'sliceAlongY' since no array reallocations is required+-- | Get slice of 2D histogram along the X axis. This function is faster+-- than 'sliceAlongY' since no array reallocations are required. sliceAlongX :: (Vector v a, Bin bX, Bin bY) => Histogram v (Bin2D bX bY) a -- ^ 2D histogram -> HistIndex bY -- ^ Position along Y axis -> Histogram v bX a sliceAlongX (Histogram (Bin2D bX bY) _ arr) y- | iy >= 0 && iy < ny = Histogram bX Nothing $ G.slice (nx * iy) nx arr+ | iy >= 0 && iy < ny = Histogram bX NoOverflow $ G.slice (nx * iy) nx arr | otherwise = error "Data.Histogram.Generic.Histogram.sliceXatIx: bad index" where nx = nBins bX@@ -528,7 +540,7 @@ -> HistIndex bX -- ^ Position along X axis -> Histogram v bY a sliceAlongY (Histogram (Bin2D bX bY) _ arr) x- | ix >= 0 && ix < nx = Histogram bY Nothing $ G.generate ny (\iy -> arr ! (iy*nx + ix))+ | ix >= 0 && ix < nx = Histogram bY NoOverflow $ G.generate ny (\iy -> arr ! (iy*nx + ix)) | otherwise = error "Data.Histogram.Generic.Histogram.sliceXatIx: bad index" where nx = nBins bX@@ -557,7 +569,7 @@ -> Histogram v (Bin2D bX bY) a -- ^ 2D histogram -> Histogram v bY b reduceX f h@(Histogram (Bin2D _ bY) _ _) =- Histogram bY Nothing $ G.generate (nBins bY) (f . sliceAlongX h . Index)+ Histogram bY NoOverflow $ G.generate (nBins bY) (f . sliceAlongX h . Index) -- | Reduce along X axis. Information about under/overlows is lost. breduceX :: (Vector v a, Vector v b, Bin bX, Bin bY)@@ -565,7 +577,7 @@ -> Histogram v (Bin2D bX bY) a -- ^ 2D histogram -> Histogram v bY b breduceX f h@(Histogram (Bin2D _ bY) _ _) =- Histogram bY Nothing $ G.generate (nBins bY) $ \i -> f (fromIndex bY i) $ sliceAlongX h (Index i)+ Histogram bY NoOverflow $ G.generate (nBins bY) $ \i -> f (fromIndex bY i) $ sliceAlongX h (Index i) -- | Reduce along Y axis. Information about under/overflows is lost.@@ -574,7 +586,7 @@ -> Histogram v (Bin2D bX bY) a -- ^ 2D histogram -> Histogram v bX b reduceY f h@(Histogram (Bin2D bX _) _ _) =- Histogram bX Nothing $ G.generate (nBins bX) (f . sliceAlongY h . Index)+ Histogram bX NoOverflow $ G.generate (nBins bX) (f . sliceAlongY h . Index) -- | Reduce along Y axis. Information about under/overflows is lost. breduceY :: (Vector v a, Vector v b, Bin bX, Bin bY)@@ -582,7 +594,7 @@ -> Histogram v (Bin2D bX bY) a -- ^ 2D histogram -> Histogram v bX b breduceY f h@(Histogram (Bin2D bX _) _ _) =- Histogram bX Nothing $ G.generate (nBins bX) $ \i -> f (fromIndex bX i) $ sliceAlongY h (Index i)+ Histogram bX NoOverflow $ G.generate (nBins bX) $ \i -> f (fromIndex bX i) $ sliceAlongY h (Index i) -- | Transform X slices of histogram.@@ -595,7 +607,7 @@ [] -> error "Data.Histogram.Generic.Histogram.liftX: zero size along Y" hs -> Histogram (Bin2D (bins (head hs)) by)- Nothing+ NoOverflow (G.concat (histData <$> hs)) -- | Transform Y slices of histogram.@@ -608,7 +620,7 @@ [] -> error "Data.Histogram.Generic.Histogram.liftY: zero size along X" hs -> make hs where- make hs = Histogram (Bin2D bx by') Nothing+ make hs = Histogram (Bin2D bx by') NoOverflow $ G.backpermute (G.concat (histData <$> hs)) (G.generate (nx*ny) join) where by' = bins (head hs)
histogram-fill.cabal view
@@ -1,5 +1,5 @@ Name: histogram-fill-Version: 0.8.4.1+Version: 0.8.5.0 Synopsis: Library for histograms creation. Description: This is library for histograms filling. Its aim to provide@@ -15,7 +15,7 @@ Category: Data Build-Type: Simple extra-source-files:- ChangeLog+ ChangeLog.md source-repository head type: hg@@ -27,13 +27,11 @@ Library Ghc-options: -O2 -Wall Ghc-prof-options: -auto-all- Build-Depends:- base >=3 && <5,- deepseq,- primitive,- ghc-prim,- monad-primitive >= 0.1,- vector >= 0.10.0.1+ Build-Depends: base >= 4.6 && <5+ , deepseq+ , primitive >= 0.5+ , ghc-prim+ , vector >= 0.10.0.1 Exposed-modules: Data.Histogram Data.Histogram.Generic@@ -44,6 +42,7 @@ Data.Histogram.Bin.BinInt Data.Histogram.Bin.BinEnum Data.Histogram.Bin.BinF+ Data.Histogram.Bin.BinVar Data.Histogram.Bin.LogBinD Data.Histogram.Bin.MaybeBin Data.Histogram.Bin.Bin2D