The following code named fib.hs
import Criterion.Main (defaultMain)
fibZ = 1:1:zipWith (+) fibZ (tail fibZ)
main = defaultMain [
bench "fibZ 10" $ \n -> fibZ (10+n-n)
]
errors with
fib.hs:45:10: Not in scope: `bench'
What is wrong? I have borrowed this example from here.
The library has changed since that blog post was written. Now you should write:
This was taken directly from the "Running benchmarks" section of the Hackage documentation for Criterion.Main.