Criterion.Monad

criterion-1.2.1.0: Robust, reliable performance measurement and analysis

Copyright | (c) 2009 Neil Brown
License | BSD-style
Maintainer | bos@serpentine.com
Stability | experimental
Portability | GHC
Safe Haskell | Trustworthy
Language | Haskell2010

Criterion.Monad

Description

The environment in which most criterion code executes.

Synopsis

- data Criterion a
- withConfig :: Config -> Criterion a -> IO a
- getGen :: Criterion GenIO
- getOverhead :: Criterion Double

# Documentation

data Criterion a #

The monad in which most criterion code executes.

Instances

Monad Criterion # |
Methods (>>=) :: Criterion a -> (a -> Criterion b) -> Criterion b # (>>) :: Criterion a -> Criterion b -> Criterion b # return :: a -> Criterion a # fail :: String -> Criterion a #
Functor Criterion # |
Methods fmap :: (a -> b) -> Criterion a -> Criterion b # (<$) :: a -> Criterion b -> Criterion a #
Applicative Criterion # |
Methods pure :: a -> Criterion a # (<*>) :: Criterion (a -> b) -> Criterion a -> Criterion b # (*>) :: Criterion a -> Criterion b -> Criterion b # (<*) :: Criterion a -> Criterion b -> Criterion a #
MonadIO Criterion # |
Methods liftIO :: IO a -> Criterion a #
MonadThrow Criterion # |
Methods throwM :: Exception e => e -> Criterion a #
MonadCatch Criterion # |
Methods catch :: Exception e => Criterion a -> (e -> Criterion a) -> Criterion a #
MonadMask Criterion # |
Methods mask :: ((forall a. Criterion a -> Criterion a) -> Criterion b) -> Criterion b # uninterruptibleMask :: ((forall a. Criterion a -> Criterion a) -> Criterion b) -> Criterion b #
MonadReader Config Criterion # |
Methods ask :: Criterion Config # local :: (Config -> Config) -> Criterion a -> Criterion a # reader :: (Config -> a) -> Criterion a #
CritHPrintfType (Criterion a) # |
Methods chPrintfImpl :: (Config -> Bool) -> PrintfCont -> Criterion a

withConfig :: Config -> Criterion a -> IO a #

Run a `Criterion` action with the given `Config`.

getGen :: Criterion GenIO #

Return a random number generator, creating one if necessary.

This is not currently thread-safe, but in a harmless way (we might call `createSystemRandom` more than once if multiple threads race).

getOverhead :: Criterion Double #

Return an estimate of the measurement overhead.