criterion 0.4.0 → 0.4.1.0
raw patch · 4 files changed
+17/−3 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Criterion: nfIO :: (NFData a) => IO a -> IO ()
+ Criterion.Main: nfIO :: (NFData a) => IO a -> IO ()
+ Criterion.Types: nfIO :: (NFData a) => IO a -> IO ()
Files
- Criterion.hs +2/−1
- Criterion/Main.hs +2/−1
- Criterion/Types.hs +12/−0
- criterion.cabal +1/−1
Criterion.hs view
@@ -15,6 +15,7 @@ , Benchmark , Pure , nf+ , nfIO , whnf , bench , bgroup@@ -33,7 +34,7 @@ import Criterion.Monad (Criterion, getConfig, getConfigItem) import Criterion.Plot (plotWith, plotKDE, plotTiming) import Criterion.Types (Benchmarkable(..), Benchmark(..), Pure,- bench, bgroup, nf, whnf)+ bench, bgroup, nf, nfIO, whnf) import Data.Array.Vector ((:*:)(..), concatU, lengthU, mapU) import Statistics.Function (createIO, minMax) import Statistics.KernelDensity (epanechnikovPDF)
Criterion/Main.hs view
@@ -32,6 +32,7 @@ , bench , bgroup , nf+ , nfIO , whnf -- * Running benchmarks , defaultMain@@ -50,7 +51,7 @@ import Criterion.MultiMap (singleton) import Criterion.Monad (Criterion, withConfig) import Criterion.Types (Benchmarkable(..), Benchmark(..), Pure, bench,- benchNames, bgroup, nf, whnf)+ benchNames, bgroup, nf, nfIO, whnf) import Data.List (isPrefixOf, sort) import Data.Monoid (Monoid(..), Last(..)) import System.Console.GetOpt
Criterion/Types.hs view
@@ -31,6 +31,7 @@ , Pure , whnf , nf+ , nfIO , bench , bgroup , benchNames@@ -52,13 +53,24 @@ WHNF :: (a -> b) -> a -> Pure NF :: NFData b => (a -> b) -> a -> Pure +-- | Apply an argument to a function, and evaluate the result to weak+-- head normal form (WHNF). whnf :: (a -> b) -> a -> Pure whnf = WHNF {-# INLINE whnf #-} +-- | Apply an argument to a function, and evaluate the result to head+-- normal form (NF). nf :: NFData b => (a -> b) -> a -> Pure nf = NF {-# INLINE nf #-}++-- | Perform an action, then evaluate its result to head normal form.+-- This is particularly useful for forcing a lazy IO action to be+-- completely performed.+nfIO :: NFData a => IO a -> IO ()+nfIO a = a >>= \k -> return $! rnf k+{-# INLINE nfIO #-} instance Benchmarkable Pure where run p@(WHNF _ _) = go p
criterion.cabal view
@@ -1,5 +1,5 @@ name: criterion-version: 0.4.0+version: 0.4.1.0 synopsis: Robust, reliable performance measurement and analysis license: BSD3 license-file: LICENSE