A Criterion benchmark suite is composed of Benchmark values, typically organized into groups. You use defaultMain to run the suite and bgroup to cluster related benchmarks under a common name.
To define an individual benchmark, use the bench function, which takes a descriptive name and a Benchmarkable value (the code to be measured).
Example structure:
main = defaultMain [
bgroup "fib" [
bench "1" $ whnf fib 1,
bench "5" $ whnf fib 5
]
]
main = defaultMain [
bgroup "fib" [
bench "1" $ whnf fib 1
, bench "5" $ whnf fib 5
, bench "9" $ whnf fib 9
, bench "11" $ whnf fib 11
]
]