| Copyright | (c) 2009-2014 Bryan O'Sullivan | 
|---|---|
| License | BSD-style | 
| Maintainer | bos@serpentine.com | 
| Stability | experimental | 
| Portability | GHC | 
| Safe Haskell | Trustworthy | 
| Language | Haskell2010 | 
Criterion.Report
Contents
Description
Reporting functions.
Synopsis
- formatReport :: [Report] -> Text -> IO Text
- report :: [Report] -> Criterion ()
- tidyTails :: KDE -> KDE
- data TemplateException = TemplateNotFound FilePath
- loadTemplate :: [FilePath] -> FilePath -> IO Text
- includeFile :: MonadIO m => [FilePath] -> FilePath -> m Text
- getTemplateDir :: IO FilePath
- vector :: (Vector v a, ToJSON a) => Text -> v a -> Value
- vector2 :: (Vector v a, Vector v b, ToJSON a, ToJSON b) => Text -> Text -> v a -> v b -> Value
Documentation
Format a series of Report values using the given Mustache template.
report :: [Report] -> Criterion () Source #
Write out a series of Report values to a single file, if
 configured to do so.
Rendering helper functions
data TemplateException Source #
A problem arose with a template.
Constructors
| TemplateNotFound FilePath | The template could not be found. | 
Instances
Load a Mustache template file.
If the name is an absolute or relative path, the search path is not used, and the name is treated as a literal path.
If the -fembed-data-files Cabal flag is enabled, this also checks
 the embedded data-files from criterion.cabal.
This function throws a TemplateException if the template could
 not be found, or an IOException if no template could be loaded.
Arguments
| :: MonadIO m | |
| => [FilePath] | Directories to search. | 
| -> FilePath | Name of the file to search for. | 
| -> m Text | 
Attempt to include the contents of a file based on a search path.
 Returns empty if the search fails or the file could not be read.
Intended for preprocessing Mustache files, e.g. replacing sections
{{#include}}file.txt{{/include}
with file contents.
getTemplateDir :: IO FilePath Source #
Return the path to the template and other files used for generating reports.
When the -fembed-data-files Cabal flag is enabled, this simply
 returns the empty path.
Render the elements of a vector.
It will substitute each value in the vector for x in the
 following Mustache template:
{{#foo}}
 {{x}}
{{/foo}}