Commits

Bryan O'Sullivan committed 727d70e

Introduce some more NFData instances

  • Participants
  • Parent commits 21fa4d7

Comments (0)

Files changed (1)

Criterion/Analysis/Types.hs

     ) where
 
 import Control.Applicative ((<$>), (<*>), empty, pure)
+import Control.DeepSeq (NFData(rnf))
 import Data.Aeson.Types
 import Data.Data (Data)
 import Data.Int (Int64)
     -- ^ More than 3 times the IQR above the third quartile.
     } deriving (Eq, Read, Show, Typeable, Data)
 
+instance NFData Outliers
+
 instance ToJSON Outliers where
     toJSON Outliers{..} = object [
                             "samplesSeen" .= samplesSeen
                                 -- are useless).
                      deriving (Eq, Ord, Read, Show, Typeable, Data)
 
+instance NFData OutlierEffect
+
 instance ToJSON OutlierEffect where
     toJSON Unaffected = "unaffected"
     toJSON Slight     = "slight"
     -- ^ Quantitative description of effect (a fraction between 0 and 1).
     } deriving (Eq, Read, Show, Typeable, Data)
 
+instance NFData OutlierVariance where
+    rnf OutlierVariance{..} = rnf ovEffect `seq` rnf ovFraction `seq` ()
+
 instance ToJSON OutlierVariance where
     toJSON OutlierVariance{..} = object [
                                    "effect" .= ovEffect
     , anOutliers :: OutlierVariance
     } deriving (Eq, Show, Typeable, Data)
 
+instance NFData SampleAnalysis where
+    rnf SampleAnalysis{..} =
+        rnf anMean `seq` rnf anStdDev `seq` rnf anOutliers `seq` ()
+
 instance ToJSON SampleAnalysis where
     toJSON SampleAnalysis{..} = object [
                                   "mean" .= anMean