Commits

Sergey Astanin committed e749e1a

Strict constructor for Stdev. UNPACKed pragmas.

Comments (0)

Files changed (1)

Data/Monoid/Statistics.hs

 
 -- | Intermediate quantities to calculate the standard deviation.
 -- Only samples of 'Double' are supported.
-data Stdev = Stdev { sumOfSquares :: Double  -- ^ Current $\sum_i (x_i)^2$
-                   , sumOfEntries :: Double  -- ^ Current $\sum_i x_i$
-                   , sampleCountStdev :: Int -- ^ Length of the sample.
+data Stdev = Stdev { sumOfSquares :: {-# UNPACK #-} !Double
+                                     -- ^ Current $\sum_i (x_i)^2$.
+                   , sumOfEntries :: {-# UNPACK #-} !Double
+                                     -- ^ Current $\sum_i x_i$.
+                   , sampleCountStdev :: {-# UNPACK #-} !Int
+                                     -- ^ Length of the sample.
                    }
            deriving Show