-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Robust, reliable performance measurement and analysis
--   
--   This library provides a powerful but simple way to measure software
--   performance. It provides both a framework for executing and analysing
--   benchmarks and a set of driver functions that makes it easy to build
--   and run benchmarks, and to analyse their results.
--   
--   The fastest way to get started is to read the <a>online tutorial</a>,
--   followed by the documentation and examples in the
--   <a>Criterion.Main</a> module.
--   
--   For examples of the kinds of reports that criterion generates, see
--   <a>the home page</a>.
@package criterion
@version 1.6.4.0


-- | Types for benchmarking.
--   
--   The core type is <a>Benchmarkable</a>, which admits both pure
--   functions and <a>IO</a> actions.
--   
--   For a pure function of type <tt>a -&gt; b</tt>, the benchmarking
--   harness calls this function repeatedly, each time with a different
--   <a>Int64</a> argument (the number of times to run the function in a
--   loop), and reduces the result the function returns to weak head normal
--   form.
--   
--   For an action of type <tt>IO a</tt>, the benchmarking harness calls
--   the action repeatedly, but does not reduce the result.
module Criterion.Types

-- | Top-level benchmarking configuration.
data Config
Config :: CL Double -> Double -> Int -> [([String], String)] -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> Maybe FilePath -> Verbosity -> FilePath -> Config

-- | Confidence interval for bootstrap estimation (greater than 0, less
--   than 1).
[confInterval] :: Config -> CL Double

-- | Number of seconds to run a single benchmark. (In practice, execution
--   time will very slightly exceed this limit.)
[timeLimit] :: Config -> Double

-- | Number of resamples to perform when bootstrapping.
[resamples] :: Config -> Int

-- | Regressions to perform.
[regressions] :: Config -> [([String], String)]

-- | File to write binary measurement and analysis data to. If not
--   specified, this will be a temporary file.
[rawDataFile] :: Config -> Maybe FilePath

-- | File to write report output to, with template expanded.
[reportFile] :: Config -> Maybe FilePath

-- | File to write CSV summary to.
[csvFile] :: Config -> Maybe FilePath

-- | File to write JSON-formatted results to.
[jsonFile] :: Config -> Maybe FilePath

-- | File to write JUnit-compatible XML results to.
[junitFile] :: Config -> Maybe FilePath

-- | Verbosity level to use when running and analysing benchmarks.
[verbosity] :: Config -> Verbosity

-- | Template file to use if writing a report.
[template] :: Config -> FilePath

-- | Control the amount of information displayed.
data Verbosity
Quiet :: Verbosity
Normal :: Verbosity
Verbose :: Verbosity
data Benchmarkable
Benchmarkable :: (Int64 -> IO a) -> (Int64 -> a -> IO ()) -> (a -> Int64 -> IO ()) -> Bool -> Benchmarkable
[allocEnv] :: Benchmarkable -> Int64 -> IO a
[cleanEnv] :: Benchmarkable -> Int64 -> a -> IO ()
[runRepeatedly] :: Benchmarkable -> a -> Int64 -> IO ()
[perRun] :: Benchmarkable -> Bool
data Benchmark
[Environment] :: forall env a. NFData env => IO env -> (env -> IO a) -> (env -> Benchmark) -> Benchmark
[Benchmark] :: String -> Benchmarkable -> Benchmark
[BenchGroup] :: String -> [Benchmark] -> Benchmark
data Measured
Measured :: !Double -> !Double -> !Int64 -> !Int64 -> !Int64 -> !Int64 -> !Int64 -> !Int64 -> !Double -> !Double -> !Double -> !Double -> Measured
[measTime] :: Measured -> !Double
[measCpuTime] :: Measured -> !Double
[measCycles] :: Measured -> !Int64
[measIters] :: Measured -> !Int64
[measAllocated] :: Measured -> !Int64
[measPeakMbAllocated] :: Measured -> !Int64
[measNumGcs] :: Measured -> !Int64
[measBytesCopied] :: Measured -> !Int64
[measMutatorWallSeconds] :: Measured -> !Double
[measMutatorCpuSeconds] :: Measured -> !Double
[measGcWallSeconds] :: Measured -> !Double
[measGcCpuSeconds] :: Measured -> !Double
fromInt :: Int64 -> Maybe Int64
toInt :: Maybe Int64 -> Int64
fromDouble :: Double -> Maybe Double
toDouble :: Maybe Double -> Double
measureAccessors :: Map String (Measured -> Maybe Double, String)
measureKeys :: [String]
measure :: Unbox a => (Measured -> a) -> Vector Measured -> Vector a
rescale :: Measured -> Measured
env :: NFData env => IO env -> (env -> Benchmark) -> Benchmark
envWithCleanup :: NFData env => IO env -> (env -> IO a) -> (env -> Benchmark) -> Benchmark
perBatchEnv :: (NFData env, NFData b) => (Int64 -> IO env) -> (env -> IO b) -> Benchmarkable
perBatchEnvWithCleanup :: (NFData env, NFData b) => (Int64 -> IO env) -> (Int64 -> env -> IO ()) -> (env -> IO b) -> Benchmarkable
perRunEnv :: (NFData env, NFData b) => IO env -> (env -> IO b) -> Benchmarkable
perRunEnvWithCleanup :: (NFData env, NFData b) => IO env -> (env -> IO ()) -> (env -> IO b) -> Benchmarkable
toBenchmarkable :: (Int64 -> IO ()) -> Benchmarkable
bench :: String -> Benchmarkable -> Benchmark
bgroup :: String -> [Benchmark] -> Benchmark
addPrefix :: String -> String -> String
benchNames :: Benchmark -> [String]
nf :: NFData b => (a -> b) -> a -> Benchmarkable
whnf :: (a -> b) -> a -> Benchmarkable
nfIO :: NFData a => IO a -> Benchmarkable
whnfIO :: IO a -> Benchmarkable
nfAppIO :: NFData b => (a -> IO b) -> a -> Benchmarkable
whnfAppIO :: (a -> IO b) -> a -> Benchmarkable

-- | Outliers from sample data, calculated using the boxplot technique.
data Outliers
Outliers :: !Int64 -> !Int64 -> !Int64 -> !Int64 -> !Int64 -> Outliers
[samplesSeen] :: Outliers -> !Int64

-- | More than 3 times the interquartile range (IQR) below the first
--   quartile.
[lowSevere] :: Outliers -> !Int64

-- | Between 1.5 and 3 times the IQR below the first quartile.
[lowMild] :: Outliers -> !Int64

-- | Between 1.5 and 3 times the IQR above the third quartile.
[highMild] :: Outliers -> !Int64

-- | More than 3 times the IQR above the third quartile.
[highSevere] :: Outliers -> !Int64

-- | A description of the extent to which outliers in the sample data
--   affect the sample mean and standard deviation.
data OutlierEffect

-- | Less than 1% effect.
Unaffected :: OutlierEffect

-- | Between 1% and 10%.
Slight :: OutlierEffect

-- | Between 10% and 50%.
Moderate :: OutlierEffect

-- | Above 50% (i.e. measurements are useless).
Severe :: OutlierEffect

-- | Analysis of the extent to which outliers in a sample affect its
--   standard deviation (and to some extent, its mean).
data OutlierVariance
OutlierVariance :: OutlierEffect -> String -> Double -> OutlierVariance

-- | Qualitative description of effect.
[ovEffect] :: OutlierVariance -> OutlierEffect

-- | Brief textual description of effect.
[ovDesc] :: OutlierVariance -> String

-- | Quantitative description of effect (a fraction between 0 and 1).
[ovFraction] :: OutlierVariance -> Double

-- | Results of a linear regression.
data Regression
Regression :: String -> Map String (Estimate ConfInt Double) -> Estimate ConfInt Double -> Regression

-- | Name of the responding variable.
[regResponder] :: Regression -> String

-- | Map from name to value of predictor coefficients.
[regCoeffs] :: Regression -> Map String (Estimate ConfInt Double)

-- | R² goodness-of-fit estimate.
[regRSquare] :: Regression -> Estimate ConfInt Double

-- | Data for a KDE chart of performance.
data KDE
KDE :: String -> Vector Double -> Vector Double -> KDE
[kdeType] :: KDE -> String
[kdeValues] :: KDE -> Vector Double
[kdePDF] :: KDE -> Vector Double

-- | Report of a sample analysis.
data Report
Report :: Int -> String -> [String] -> Vector Measured -> SampleAnalysis -> Outliers -> [KDE] -> Report

-- | A simple index indicating that this is the <i>n</i>th report.
[reportNumber] :: Report -> Int

-- | The name of this report.
[reportName] :: Report -> String

-- | See <a>measureKeys</a>.
[reportKeys] :: Report -> [String]

-- | Raw measurements.
[reportMeasured] :: Report -> Vector Measured

-- | Report analysis.
[reportAnalysis] :: Report -> SampleAnalysis

-- | Analysis of outliers.
[reportOutliers] :: Report -> Outliers

-- | Data for a KDE of times.
[reportKDEs] :: Report -> [KDE]

-- | Result of a bootstrap analysis of a non-parametric sample.
data SampleAnalysis
SampleAnalysis :: [Regression] -> Estimate ConfInt Double -> Estimate ConfInt Double -> OutlierVariance -> SampleAnalysis

-- | Estimates calculated via linear regression.
[anRegress] :: SampleAnalysis -> [Regression]

-- | Estimated mean.
[anMean] :: SampleAnalysis -> Estimate ConfInt Double

-- | Estimated standard deviation.
[anStdDev] :: SampleAnalysis -> Estimate ConfInt Double

-- | Description of the effects of outliers on the estimated variance.
[anOutlierVar] :: SampleAnalysis -> OutlierVariance
data DataRecord
Measurement :: Int -> String -> Vector Measured -> DataRecord
Analysed :: Report -> DataRecord
instance Data.Binary.Class.Binary Criterion.Types.DataRecord
instance Data.Binary.Class.Binary Criterion.Types.KDE
instance Data.Binary.Class.Binary Criterion.Types.OutlierEffect
instance Data.Binary.Class.Binary Criterion.Types.OutlierVariance
instance Data.Binary.Class.Binary Criterion.Types.Outliers
instance Data.Binary.Class.Binary Criterion.Types.Regression
instance Data.Binary.Class.Binary Criterion.Types.Report
instance Data.Binary.Class.Binary Criterion.Types.SampleAnalysis
instance GHC.Enum.Bounded Criterion.Types.Verbosity
instance Data.Data.Data Criterion.Types.Config
instance Data.Data.Data Criterion.Types.KDE
instance Data.Data.Data Criterion.Types.OutlierEffect
instance Data.Data.Data Criterion.Types.OutlierVariance
instance Data.Data.Data Criterion.Types.Outliers
instance Data.Data.Data Criterion.Types.Verbosity
instance GHC.Enum.Enum Criterion.Types.Verbosity
instance GHC.Classes.Eq Criterion.Types.Config
instance GHC.Classes.Eq Criterion.Types.DataRecord
instance GHC.Classes.Eq Criterion.Types.KDE
instance GHC.Classes.Eq Criterion.Types.OutlierEffect
instance GHC.Classes.Eq Criterion.Types.OutlierVariance
instance GHC.Classes.Eq Criterion.Types.Outliers
instance GHC.Classes.Eq Criterion.Types.Regression
instance GHC.Classes.Eq Criterion.Types.Report
instance GHC.Classes.Eq Criterion.Types.SampleAnalysis
instance GHC.Classes.Eq Criterion.Types.Verbosity
instance Data.Aeson.Types.FromJSON.FromJSON Criterion.Types.DataRecord
instance Data.Aeson.Types.FromJSON.FromJSON Criterion.Types.KDE
instance Data.Aeson.Types.FromJSON.FromJSON Criterion.Types.OutlierEffect
instance Data.Aeson.Types.FromJSON.FromJSON Criterion.Types.OutlierVariance
instance Data.Aeson.Types.FromJSON.FromJSON Criterion.Types.Outliers
instance Data.Aeson.Types.FromJSON.FromJSON Criterion.Types.Regression
instance Data.Aeson.Types.FromJSON.FromJSON Criterion.Types.Report
instance Data.Aeson.Types.FromJSON.FromJSON Criterion.Types.SampleAnalysis
instance GHC.Generics.Generic Criterion.Types.Config
instance GHC.Generics.Generic Criterion.Types.DataRecord
instance GHC.Generics.Generic Criterion.Types.KDE
instance GHC.Generics.Generic Criterion.Types.OutlierEffect
instance GHC.Generics.Generic Criterion.Types.OutlierVariance
instance GHC.Generics.Generic Criterion.Types.Outliers
instance GHC.Generics.Generic Criterion.Types.Regression
instance GHC.Generics.Generic Criterion.Types.Report
instance GHC.Generics.Generic Criterion.Types.SampleAnalysis
instance GHC.Generics.Generic Criterion.Types.Verbosity
instance GHC.Base.Monoid Criterion.Types.Outliers
instance Control.DeepSeq.NFData Criterion.Types.DataRecord
instance Control.DeepSeq.NFData Criterion.Types.KDE
instance Control.DeepSeq.NFData Criterion.Types.OutlierEffect
instance Control.DeepSeq.NFData Criterion.Types.OutlierVariance
instance Control.DeepSeq.NFData Criterion.Types.Outliers
instance Control.DeepSeq.NFData Criterion.Types.Regression
instance Control.DeepSeq.NFData Criterion.Types.Report
instance Control.DeepSeq.NFData Criterion.Types.SampleAnalysis
instance GHC.Classes.Ord Criterion.Types.OutlierEffect
instance GHC.Classes.Ord Criterion.Types.Verbosity
instance GHC.Read.Read Criterion.Types.Config
instance GHC.Read.Read Criterion.Types.DataRecord
instance GHC.Read.Read Criterion.Types.KDE
instance GHC.Read.Read Criterion.Types.OutlierEffect
instance GHC.Read.Read Criterion.Types.OutlierVariance
instance GHC.Read.Read Criterion.Types.Outliers
instance GHC.Read.Read Criterion.Types.Regression
instance GHC.Read.Read Criterion.Types.Report
instance GHC.Read.Read Criterion.Types.SampleAnalysis
instance GHC.Read.Read Criterion.Types.Verbosity
instance GHC.Base.Semigroup Criterion.Types.Outliers
instance GHC.Show.Show Criterion.Types.Config
instance GHC.Show.Show Criterion.Types.DataRecord
instance GHC.Show.Show Criterion.Types.KDE
instance GHC.Show.Show Criterion.Types.OutlierEffect
instance GHC.Show.Show Criterion.Types.OutlierVariance
instance GHC.Show.Show Criterion.Types.Outliers
instance GHC.Show.Show Criterion.Types.Regression
instance GHC.Show.Show Criterion.Types.Report
instance GHC.Show.Show Criterion.Types.SampleAnalysis
instance GHC.Show.Show Criterion.Types.Verbosity
instance Data.Aeson.Types.ToJSON.ToJSON Criterion.Types.DataRecord
instance Data.Aeson.Types.ToJSON.ToJSON Criterion.Types.KDE
instance Data.Aeson.Types.ToJSON.ToJSON Criterion.Types.OutlierEffect
instance Data.Aeson.Types.ToJSON.ToJSON Criterion.Types.OutlierVariance
instance Data.Aeson.Types.ToJSON.ToJSON Criterion.Types.Outliers
instance Data.Aeson.Types.ToJSON.ToJSON Criterion.Types.Regression
instance Data.Aeson.Types.ToJSON.ToJSON Criterion.Types.Report
instance Data.Aeson.Types.ToJSON.ToJSON Criterion.Types.SampleAnalysis


-- | The environment in which most criterion code executes.
module Criterion.Monad

-- | The monad in which most criterion code executes.
data Criterion a

-- | Run a <a>Criterion</a> action with the given <a>Config</a>.
withConfig :: Config -> Criterion a -> IO a

-- | Return a random number generator, creating one if necessary.
--   
--   This is not currently thread-safe, but in a harmless way (we might
--   call <a>createSystemRandom</a> more than once if multiple threads
--   race).
getGen :: Criterion GenIO


-- | Input and output actions.
module Criterion.IO.Printf

-- | An internal class that acts like Printf/HPrintf.
--   
--   The implementation is visible to the rest of the program, but the
--   details of the class are not.
class CritHPrintfType a

-- | Print a "normal" note.
note :: CritHPrintfType r => String -> r

-- | Print an error message.
printError :: CritHPrintfType r => String -> r

-- | Print verbose output.
prolix :: CritHPrintfType r => String -> r

-- | Write a record to a CSV file.
writeCsv :: ToRecord a => a -> Criterion ()
instance Criterion.IO.Printf.CritHPrintfType (Criterion.Monad.Internal.Criterion a)
instance (Criterion.IO.Printf.CritHPrintfType r, Text.Printf.PrintfArg a) => Criterion.IO.Printf.CritHPrintfType (a -> r)
instance Criterion.IO.Printf.CritHPrintfType (GHC.Types.IO a)


-- | Analysis code for benchmarks.
module Criterion.Analysis

-- | Outliers from sample data, calculated using the boxplot technique.
data Outliers
Outliers :: !Int64 -> !Int64 -> !Int64 -> !Int64 -> !Int64 -> Outliers
[samplesSeen] :: Outliers -> !Int64

-- | More than 3 times the interquartile range (IQR) below the first
--   quartile.
[lowSevere] :: Outliers -> !Int64

-- | Between 1.5 and 3 times the IQR below the first quartile.
[lowMild] :: Outliers -> !Int64

-- | Between 1.5 and 3 times the IQR above the third quartile.
[highMild] :: Outliers -> !Int64

-- | More than 3 times the IQR above the third quartile.
[highSevere] :: Outliers -> !Int64

-- | A description of the extent to which outliers in the sample data
--   affect the sample mean and standard deviation.
data OutlierEffect

-- | Less than 1% effect.
Unaffected :: OutlierEffect

-- | Between 1% and 10%.
Slight :: OutlierEffect

-- | Between 10% and 50%.
Moderate :: OutlierEffect

-- | Above 50% (i.e. measurements are useless).
Severe :: OutlierEffect

-- | Analysis of the extent to which outliers in a sample affect its
--   standard deviation (and to some extent, its mean).
data OutlierVariance
OutlierVariance :: OutlierEffect -> String -> Double -> OutlierVariance

-- | Qualitative description of effect.
[ovEffect] :: OutlierVariance -> OutlierEffect

-- | Brief textual description of effect.
[ovDesc] :: OutlierVariance -> String

-- | Quantitative description of effect (a fraction between 0 and 1).
[ovFraction] :: OutlierVariance -> Double

-- | Result of a bootstrap analysis of a non-parametric sample.
data SampleAnalysis
SampleAnalysis :: [Regression] -> Estimate ConfInt Double -> Estimate ConfInt Double -> OutlierVariance -> SampleAnalysis

-- | Estimates calculated via linear regression.
[anRegress] :: SampleAnalysis -> [Regression]

-- | Estimated mean.
[anMean] :: SampleAnalysis -> Estimate ConfInt Double

-- | Estimated standard deviation.
[anStdDev] :: SampleAnalysis -> Estimate ConfInt Double

-- | Description of the effects of outliers on the estimated variance.
[anOutlierVar] :: SampleAnalysis -> OutlierVariance

-- | Perform an analysis of a measurement.
analyseSample :: Int -> String -> Vector Measured -> ExceptT String Criterion Report

-- | Multiply the <tt>Estimate</tt>s in an analysis by the given value,
--   using <a>scale</a>.
scale :: Double -> SampleAnalysis -> SampleAnalysis

-- | Display the mean of a <a>Sample</a>, and characterise the outliers
--   present in the sample.
analyseMean :: Sample -> Int -> Criterion Double

-- | Count the total number of outliers in a sample.
countOutliers :: Outliers -> Int64

-- | Classify outliers in a data set, using the boxplot technique.
classifyOutliers :: Sample -> Outliers

-- | Display a report of the <a>Outliers</a> present in a <a>Sample</a>.
noteOutliers :: Outliers -> Criterion ()

-- | Compute the extent to which outliers in the sample data affect the
--   sample mean and standard deviation.
outlierVariance :: Estimate ConfInt Double -> Estimate ConfInt Double -> Double -> OutlierVariance

-- | Given a list of accessor names (see <a>measureKeys</a>), return either
--   a mapping from accessor name to function or an error message if any
--   names are wrong.
resolveAccessors :: [String] -> Either String [(String, Measured -> Maybe Double)]

-- | Given predictor and responder names, do some basic validation, then
--   hand back the relevant accessors.
validateAccessors :: [String] -> String -> Either String [(String, Measured -> Maybe Double)]

-- | Regress the given predictors against the responder.
--   
--   Errors may be returned under various circumstances, such as invalid
--   names or lack of needed data.
--   
--   See <a>olsRegress</a> for details of the regression performed.
regress :: GenIO -> [String] -> String -> Vector Measured -> ExceptT String Criterion Regression


-- | Reporting functions.
module Criterion.Report

-- | Format a series of <a>Report</a> values using the given Mustache
--   template.
formatReport :: [Report] -> Text -> IO Text

-- | Write out a series of <a>Report</a> values to a single file, if
--   configured to do so.
report :: [Report] -> Criterion ()

-- | Trim long flat tails from a KDE plot.
tidyTails :: KDE -> KDE

-- | A problem arose with a template.
data TemplateException

-- | The template could not be found.
TemplateNotFound :: FilePath -> TemplateException

-- | Load a Mustache template file.
--   
--   If the name is an absolute or relative path, the search path is
--   <i>not</i> used, and the name is treated as a literal path.
--   
--   If the <tt>-fembed-data-files</tt> <tt>Cabal</tt> flag is enabled,
--   this also checks the embedded <tt>data-files</tt> from
--   <tt>criterion.cabal</tt>.
--   
--   This function throws a <a>TemplateException</a> if the template could
--   not be found, or an <a>IOException</a> if no template could be loaded.
loadTemplate :: [FilePath] -> FilePath -> IO Text

-- | Attempt to include the contents of a file based on a search path.
--   Returns <a>empty</a> if the search fails or the file could not be
--   read.
--   
--   Intended for preprocessing Mustache files, e.g. replacing sections
--   
--   <pre>
--   {{#include}}file.txt{{/include}
--   </pre>
--   
--   with file contents.
includeFile :: MonadIO m => [FilePath] -> FilePath -> m Text

-- | Return the path to the template and other files used for generating
--   reports.
--   
--   When the <tt>-fembed-data-files</tt> <tt>Cabal</tt> flag is enabled,
--   this simply returns the empty path.
getTemplateDir :: IO FilePath

-- | Render the elements of a vector.
--   
--   It will substitute each value in the vector for <tt>x</tt> in the
--   following Mustache template:
--   
--   <pre>
--   {{#foo}}
--    {{x}}
--   {{/foo}}
--   </pre>
vector :: (Vector v a, ToJSON a) => Text -> v a -> Value

-- | Render the elements of two vectors.
vector2 :: (Vector v a, Vector v b, ToJSON a, ToJSON b) => Text -> Text -> v a -> v b -> Value
instance Data.Data.Data Criterion.Report.TemplateException
instance GHC.Classes.Eq Criterion.Report.TemplateException
instance GHC.Exception.Type.Exception Criterion.Report.TemplateException
instance GHC.Generics.Generic Criterion.Report.TemplateException
instance GHC.Read.Read Criterion.Report.TemplateException
instance GHC.Show.Show Criterion.Report.TemplateException


-- | Benchmarking command-line configuration.
module Criterion.Main.Options

-- | Execution mode for a benchmark program.
data Mode

-- | List all benchmarks.
List :: Mode

-- | Print the version.
Version :: Mode

-- | Run the given benchmarks, without collecting or analysing performance
--   numbers.
RunIters :: Config -> Int64 -> MatchType -> [String] -> Mode

-- | Run and analyse the given benchmarks.
Run :: Config -> MatchType -> [String] -> Mode

-- | How to match a benchmark name.
data MatchType

-- | Match by prefix. For example, a prefix of <tt>"foo"</tt> will match
--   <tt>"foobar"</tt>.
Prefix :: MatchType

-- | Match by Unix-style glob pattern. When using this match type,
--   benchmark names are treated as if they were file-paths. For example,
--   the glob patterns <tt>"*/ba*"</tt> and <tt>"*/*"</tt> will match
--   <tt>"foo/bar"</tt>, but <tt>"*"</tt> or <tt>"*bar"</tt> <b>will
--   not</b>.
Glob :: MatchType

-- | Match by searching given substring in benchmark paths.
Pattern :: MatchType

-- | Same as <a>Pattern</a>, but case insensitive.
IPattern :: MatchType

-- | Default benchmarking configuration.
defaultConfig :: Config

-- | Parse a command line.
parseWith :: Config -> Parser Mode

-- | Parse a configuration.
config :: Config -> Parser Config

-- | Flesh out a command-line parser.
describe :: Config -> ParserInfo Mode

-- | Flesh out command-line information using a custom <a>Parser</a>.
describeWith :: Parser a -> ParserInfo a

-- | A string describing the version of this benchmark (really, the version
--   of criterion that was used to build it).
versionInfo :: String
instance GHC.Enum.Bounded Criterion.Main.Options.MatchType
instance Data.Data.Data Criterion.Main.Options.MatchType
instance Data.Data.Data Criterion.Main.Options.Mode
instance GHC.Enum.Enum Criterion.Main.Options.MatchType
instance GHC.Classes.Eq Criterion.Main.Options.MatchType
instance GHC.Classes.Eq Criterion.Main.Options.Mode
instance GHC.Generics.Generic Criterion.Main.Options.MatchType
instance GHC.Generics.Generic Criterion.Main.Options.Mode
instance GHC.Classes.Ord Criterion.Main.Options.MatchType
instance GHC.Read.Read Criterion.Main.Options.MatchType
instance GHC.Read.Read Criterion.Main.Options.Mode
instance GHC.Show.Show Criterion.Main.Options.MatchType
instance GHC.Show.Show Criterion.Main.Options.Mode


-- | Input and output actions.
module Criterion.IO

-- | The header identifies a criterion data file. This contains version
--   information; there is no expectation of cross-version compatibility.
header :: ByteString

-- | The magic string we expect to start off the header.
headerRoot :: String

-- | The current version of criterion, encoded into a string that is used
--   in files.
critVersion :: String

-- | Read all records from the given <a>Handle</a>.
hGetRecords :: Binary a => Handle -> IO (Either String [a])

-- | Write records to the given <a>Handle</a>.
hPutRecords :: Binary a => Handle -> [a] -> IO ()

-- | Read all records from the given file.
readRecords :: Binary a => FilePath -> IO (Either String [a])

-- | Write records to the given file.
writeRecords :: Binary a => FilePath -> [a] -> IO ()

-- | On disk we store (name,version,reports), where <a>version</a> is the
--   version of Criterion used to generate the file.
type ReportFileContents = (String, String, [Report])

-- | Alternative file IO with JSON instances. Read a list of reports from a
--   .json file produced by criterion.
--   
--   If the version does not match exactly, this issues a warning.
readJSONReports :: FilePath -> IO (Either String ReportFileContents)

-- | Write a list of reports to a JSON file. Includes a header, which
--   includes the current Criterion version number. This should be the
--   inverse of <a>readJSONReports</a>.
writeJSONReports :: FilePath -> [Report] -> IO ()


-- | Core benchmarking code.
module Criterion.Internal

-- | Run, and analyse, one or more benchmarks.
runAndAnalyse :: (String -> Bool) -> Benchmark -> Criterion ()

-- | Run a single benchmark and analyse its performance.
runAndAnalyseOne :: Int -> String -> Benchmarkable -> Criterion DataRecord

-- | Run a single benchmark.
runOne :: Int -> String -> Benchmarkable -> Criterion DataRecord

-- | Run a benchmark without analysing its performance.
runFixedIters :: Int64 -> (String -> Bool) -> Benchmark -> Criterion ()


-- | Wrappers for compiling and running benchmarks quickly and easily. See
--   <a>defaultMain</a> below for an example.
--   
--   All of the <a>IO</a>-returning functions in this module initialize the
--   timer before measuring time (refer to the documentation for
--   <a>initializeTime</a> for more details).
module Criterion.Main
data Benchmarkable
data Benchmark
env :: NFData env => IO env -> (env -> Benchmark) -> Benchmark
envWithCleanup :: NFData env => IO env -> (env -> IO a) -> (env -> Benchmark) -> Benchmark
perBatchEnv :: (NFData env, NFData b) => (Int64 -> IO env) -> (env -> IO b) -> Benchmarkable
perBatchEnvWithCleanup :: (NFData env, NFData b) => (Int64 -> IO env) -> (Int64 -> env -> IO ()) -> (env -> IO b) -> Benchmarkable
perRunEnv :: (NFData env, NFData b) => IO env -> (env -> IO b) -> Benchmarkable
perRunEnvWithCleanup :: (NFData env, NFData b) => IO env -> (env -> IO ()) -> (env -> IO b) -> Benchmarkable
toBenchmarkable :: (Int64 -> IO ()) -> Benchmarkable
bench :: String -> Benchmarkable -> Benchmark
bgroup :: String -> [Benchmark] -> Benchmark
nf :: NFData b => (a -> b) -> a -> Benchmarkable
whnf :: (a -> b) -> a -> Benchmarkable
nfIO :: NFData a => IO a -> Benchmarkable
whnfIO :: IO a -> Benchmarkable
nfAppIO :: NFData b => (a -> IO b) -> a -> Benchmarkable
whnfAppIO :: (a -> IO b) -> a -> Benchmarkable

-- | An entry point that can be used as a <tt>main</tt> function.
--   
--   <pre>
--   import Criterion.Main
--   
--   fib :: Int -&gt; Int
--   fib 0 = 0
--   fib 1 = 1
--   fib n = fib (n-1) + fib (n-2)
--   
--   main = defaultMain [
--          bgroup "fib" [ bench "10" $ whnf fib 10
--                       , bench "35" $ whnf fib 35
--                       , bench "37" $ whnf fib 37
--                       ]
--                      ]
--   </pre>
defaultMain :: [Benchmark] -> IO ()

-- | An entry point that can be used as a <tt>main</tt> function, with
--   configurable defaults.
--   
--   Example:
--   
--   <pre>
--   import Criterion.Main.Options
--   import Criterion.Main
--   
--   myConfig = defaultConfig {
--                 -- Resample 10 times for bootstrapping
--                 resamples = 10
--              }
--   
--   main = defaultMainWith myConfig [
--            bench "fib 30" $ whnf fib 30
--          ]
--   </pre>
--   
--   If you save the above example as <tt>"Fib.hs"</tt>, you should be able
--   to compile it as follows:
--   
--   <pre>
--   ghc -O --make Fib
--   </pre>
--   
--   Run <tt>"Fib --help"</tt> on the command line to get a list of command
--   line options.
defaultMainWith :: Config -> [Benchmark] -> IO ()

-- | Default benchmarking configuration.
defaultConfig :: Config

-- | Create a function that can tell if a name given on the command line
--   matches a benchmark.
makeMatcher :: MatchType -> [String] -> Either String (String -> Bool)

-- | Run a set of <a>Benchmark</a>s with the given <a>Mode</a>.
--   
--   This can be useful if you have a <a>Mode</a> from some other source
--   (e.g. from a one in your benchmark driver's command-line parser).
runMode :: Mode -> [Benchmark] -> IO ()


-- | Core benchmarking code.
module Criterion
data Benchmarkable
data Benchmark
env :: NFData env => IO env -> (env -> Benchmark) -> Benchmark
envWithCleanup :: NFData env => IO env -> (env -> IO a) -> (env -> Benchmark) -> Benchmark
perBatchEnv :: (NFData env, NFData b) => (Int64 -> IO env) -> (env -> IO b) -> Benchmarkable
perBatchEnvWithCleanup :: (NFData env, NFData b) => (Int64 -> IO env) -> (Int64 -> env -> IO ()) -> (env -> IO b) -> Benchmarkable
perRunEnv :: (NFData env, NFData b) => IO env -> (env -> IO b) -> Benchmarkable
perRunEnvWithCleanup :: (NFData env, NFData b) => IO env -> (env -> IO ()) -> (env -> IO b) -> Benchmarkable
toBenchmarkable :: (Int64 -> IO ()) -> Benchmarkable
bench :: String -> Benchmarkable -> Benchmark
bgroup :: String -> [Benchmark] -> Benchmark
nf :: NFData b => (a -> b) -> a -> Benchmarkable
whnf :: (a -> b) -> a -> Benchmarkable
nfIO :: NFData a => IO a -> Benchmarkable
whnfIO :: IO a -> Benchmarkable
nfAppIO :: NFData b => (a -> IO b) -> a -> Benchmarkable
whnfAppIO :: (a -> IO b) -> a -> Benchmarkable

-- | Run a benchmark interactively, and analyse its performance.
benchmark :: Benchmarkable -> IO ()

-- | Run a benchmark interactively, and analyse its performance.
benchmarkWith :: Config -> Benchmarkable -> IO ()

-- | Run a benchmark interactively, analyse its performance, and return the
--   analysis.
benchmark' :: Benchmarkable -> IO Report

-- | Run a benchmark interactively, analyse its performance, and return the
--   analysis.
benchmarkWith' :: Config -> Benchmarkable -> IO Report
