Copyright | (c) 2009-2014 Bryan O'Sullivan |
---|---|
License | BSD-style |
Maintainer | bos@serpentine.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Input and output actions.
Synopsis
- header :: ByteString
- headerRoot :: String
- critVersion :: String
- hGetRecords :: Binary a => Handle -> IO (Either String [a])
- hPutRecords :: Binary a => Handle -> [a] -> IO ()
- readRecords :: Binary a => FilePath -> IO (Either String [a])
- writeRecords :: Binary a => FilePath -> [a] -> IO ()
- type ReportFileContents = (String, String, [Report])
- readJSONReports :: FilePath -> IO (Either String ReportFileContents)
- writeJSONReports :: FilePath -> [Report] -> IO ()
Documentation
header :: ByteString Source #
The header identifies a criterion data file. This contains version information; there is no expectation of cross-version compatibility.
headerRoot :: String Source #
The magic string we expect to start off the header.
critVersion :: String Source #
The current version of criterion, encoded into a string that is used in files.
hGetRecords :: Binary a => Handle -> IO (Either String [a]) Source #
Read all records from the given Handle
.
readRecords :: Binary a => FilePath -> IO (Either String [a]) Source #
Read all records from the given file.
type ReportFileContents = (String, String, [Report]) Source #
On disk we store (name,version,reports), where
version
is the version of Criterion used to generate the file.
readJSONReports :: FilePath -> IO (Either String ReportFileContents) Source #
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.
writeJSONReports :: FilePath -> [Report] -> IO () Source #
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 readJSONReports
.