I am very new to Haskell.
I am trying to use Criterion to get performance data. My Main module is as follows:
module Main where
import SingleThreadedBlockChain
import Data.Time.Clock.System (getSystemTime)
import System.IO (readFile)
import System.TimeIt
import System.Environment ( getArgs )
import Criterion.Main
main :: IO ()
main = do
args <- getArgs
time <- getSystemTime
content <- readFile (args !! 0)
defaultMain [
bench "putStrLn" $ nfIO (putStrLn ("The last block is " ++ show (last (makeBlockChain "" (lines content) 0 (show time)))))
]
I am trying to use the Criterion documentation + things I've seen on StackOverflow to get this working. I'm getting the following error:
Error: none of the specified names matches a benchmark
I thought I would be benchmarking IO. From the examples I've seen, the names don't always match the benchmarks. Could someone explain how the names should relate to the benchmarks?