criterion-1.6.4.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

# Documentation

data Criterion a #

The monad in which most criterion code executes.

#### Instances

Instances details

MonadIO Criterion # |
Instance details Defined in Criterion.Monad.Internal Methods liftIO :: IO a -> Criterion a #
MonadCatch Criterion # |
Instance details Defined in Criterion.Monad.Internal Methods catch :: (HasCallStack, Exception e) => Criterion a -> (e -> Criterion a) -> Criterion a #
MonadMask Criterion # |
Instance details Defined in Criterion.Monad.Internal Methods mask :: HasCallStack => ((forall a. Criterion a -> Criterion a) -> Criterion b) -> Criterion b # uninterruptibleMask :: HasCallStack => ((forall a. Criterion a -> Criterion a) -> Criterion b) -> Criterion b # generalBracket :: HasCallStack => Criterion a -> (a -> ExitCase b -> Criterion c) -> (a -> Criterion b) -> Criterion (b, c) #
MonadThrow Criterion # |
Instance details Defined in Criterion.Monad.Internal Methods throwM :: (HasCallStack, Exception e) => e -> Criterion a #
Applicative Criterion # |
Instance details Defined in Criterion.Monad.Internal Methods pure :: a -> Criterion a # (<*>) :: Criterion (a -> b) -> Criterion a -> Criterion b # liftA2 :: (a -> b -> c) -> Criterion a -> Criterion b -> Criterion c # (*>) :: Criterion a -> Criterion b -> Criterion b # (<*) :: Criterion a -> Criterion b -> Criterion a #
Functor Criterion # |
Instance details Defined in Criterion.Monad.Internal Methods fmap :: (a -> b) -> Criterion a -> Criterion b # (<$) :: a -> Criterion b -> Criterion a #
Monad Criterion # |
Instance details Defined in Criterion.Monad.Internal Methods (>>=) :: Criterion a -> (a -> Criterion b) -> Criterion b # (>>) :: Criterion a -> Criterion b -> Criterion b # return :: a -> Criterion a #
MonadFail Criterion # |
Instance details Defined in Criterion.Monad.Internal Methods fail :: String -> Criterion a #
MonadReader Config Criterion # |
Instance details Defined in Criterion.Monad.Internal Methods ask :: Criterion Config # local :: (Config -> Config) -> Criterion a -> Criterion a # reader :: (Config -> a) -> Criterion a #
CritHPrintfType (Criterion a) # |
Instance details Defined in Criterion.IO.Printf 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).