Commits

Bryan O'Sullivan committed 53ac940

Small refactoring for style.

  • Participants
  • Parent commits 51caa27

Comments (0)

Files changed (1)

     , runAndAnalyse
     ) where
 
-import Control.Monad (replicateM_, when, liftM, (<=<))
+import Control.Monad ((<=<), forM_, liftM, replicateM_, when)
 import Criterion.Analysis (OutlierVariance(..), classifyOutliers,
                            outlierVariance, noteOutliers)
 import Criterion.Config (Config(..), Plot(..), fromLJ)
                                      (epanechnikovPDF 100 times)
 
 plotAll :: Config -> [(String, Sample)] -> IO ()
-plotAll cfg descTimes = sequence_ [do
+plotAll cfg descTimes = forM_ descTimes $ \(desc,times) -> do
   plotWith Timing cfg $ \o -> plotTiming o desc times
   plotWith KernelDensity cfg $ \o -> uncurry (plotKDE o desc extremes)
                                             (epanechnikovPDF 100 times)
-            | (desc, times) <- descTimes]
   where
     extremes :: Maybe (Double, Double)
     extremes = foldl minMaxMaybe2 Nothing $ mapMaybe (foldlU minMaxMaybe Nothing . snd) descTimes
               -> IO ()
 runAndAnalyse p cfg env
   = (if plotSame
-       then plotAll cfg
-       else const $ return ()
-    ) <=< go ""
+     then plotAll cfg
+     else const $ return ()) <=< go ""
   where go pfx (Benchmark desc b)
             | p desc'   = do note cfg "\nbenchmarking %s\n" desc'
                              x <- runAndAnalyseOne cfg env desc' b
         prefix ""  desc = desc
         prefix pfx desc = pfx ++ '/' : desc
 
-        plotSame = fromMaybe False $ getLast $ cfgPlotSameAxis cfg
+        plotSame = fromMaybe False . getLast . cfgPlotSameAxis $ cfg