means-0.1.0.0: calculate varieties of mean/average using semigroup.

Data.Semigroup.Means

Synopsis

# Arithmetic mean

data AM a Source #

semigroup for accumalting Arithmetic mean

Instances

 Eq a => Eq (AM a) Source # Methods(==) :: AM a -> AM a -> Bool #(/=) :: AM a -> AM a -> Bool # Show a => Show (AM a) Source # MethodsshowsPrec :: Int -> AM a -> ShowS #show :: AM a -> String #showList :: [AM a] -> ShowS # Num a => Semigroup (AM a) Source # Methods(<>) :: AM a -> AM a -> AM a #sconcat :: NonEmpty (AM a) -> AM a #stimes :: Integral b => b -> AM a -> AM a #

amSum :: AM a -> a Source #

am :: Num a => a -> AM a Source #

AM with weight 1.

am' :: Num a => Int -> a -> AM a Source #

AM with weight(weight is Int with 1 as unit).

getAM :: Fractional a => AM a -> a Source #

# Geometric mean

data GM a Source #

semigroup for accumalting Geometric mean

Instances

 Eq a => Eq (GM a) Source # Methods(==) :: GM a -> GM a -> Bool #(/=) :: GM a -> GM a -> Bool # Show a => Show (GM a) Source # MethodsshowsPrec :: Int -> GM a -> ShowS #show :: GM a -> String #showList :: [GM a] -> ShowS # Num a => Semigroup (GM a) Source # Methods(<>) :: GM a -> GM a -> GM a #sconcat :: NonEmpty (GM a) -> GM a #stimes :: Integral b => b -> GM a -> GM a #

gmProduct :: GM a -> a Source #

gm :: Num a => a -> GM a Source #

getGM :: Floating a => GM a -> a Source #

# Harmonic mean

data HM a Source #

semigroup for accumalting Harmonic mean

Instances

 Eq a => Eq (HM a) Source # Methods(==) :: HM a -> HM a -> Bool #(/=) :: HM a -> HM a -> Bool # Show a => Show (HM a) Source # MethodsshowsPrec :: Int -> HM a -> ShowS #show :: HM a -> String #showList :: [HM a] -> ShowS # Num a => Semigroup (HM a) Source # Methods(<>) :: HM a -> HM a -> HM a #sconcat :: NonEmpty (HM a) -> HM a #stimes :: Integral b => b -> HM a -> HM a #

hmSum :: HM a -> a Source #

hm :: Fractional a => a -> HM a Source #

getHM :: Fractional a => HM a -> a Source #

data QM a Source #

Instances

 Eq a => Eq (QM a) Source # Methods(==) :: QM a -> QM a -> Bool #(/=) :: QM a -> QM a -> Bool # Show a => Show (QM a) Source # MethodsshowsPrec :: Int -> QM a -> ShowS #show :: QM a -> String #showList :: [QM a] -> ShowS # Num a => Semigroup (QM a) Source # Methods(<>) :: QM a -> QM a -> QM a #sconcat :: NonEmpty (QM a) -> QM a #stimes :: Integral b => b -> QM a -> QM a #

qmSum :: QM a -> a Source #

qm :: Fractional a => a -> QM a Source #

getQM :: Floating a => QM a -> a Source #

# Cubic mean

data CM a Source #

semigroup for accumalting Cubic mean

Instances

 Eq a => Eq (CM a) Source # Methods(==) :: CM a -> CM a -> Bool #(/=) :: CM a -> CM a -> Bool # Show a => Show (CM a) Source # MethodsshowsPrec :: Int -> CM a -> ShowS #show :: CM a -> String #showList :: [CM a] -> ShowS # Num a => Semigroup (CM a) Source # Methods(<>) :: CM a -> CM a -> CM a #sconcat :: NonEmpty (CM a) -> CM a #stimes :: Integral b => b -> CM a -> CM a #

cmSum :: CM a -> a Source #

cm :: Fractional a => a -> CM a Source #

getCM :: Floating a => CM a -> a Source #

# Midrange mean

data MM a Source #

semigroup for accumalting Midrange mean

Instances

 Eq a => Eq (MM a) Source # Methods(==) :: MM a -> MM a -> Bool #(/=) :: MM a -> MM a -> Bool # Show a => Show (MM a) Source # MethodsshowsPrec :: Int -> MM a -> ShowS #show :: MM a -> String #showList :: [MM a] -> ShowS # Ord a => Semigroup (MM a) Source # Methods(<>) :: MM a -> MM a -> MM a #sconcat :: NonEmpty (MM a) -> MM a #stimes :: Integral b => b -> MM a -> MM a #

mmMin :: MM a -> a Source #

mmMax :: MM a -> a Source #

mm :: a -> MM a Source #

getMM :: Fractional a => MM a -> a Source #