Let’s say I have a type called BenchmarkResult
and a couple of values
bench1, bench2, bench3 :: IO [BenchmarkResult]
I also have this function that pretty prints [BenchmarkResult]
printBenchmarkResults :: [BenchmarkResult] -> IO ()
My main program is something like this:
main :: IO ()
main = printBenchmarkResults . concat =<<
(fmap concat . replicateM nTrials $ sequence [
bench1, bench2, bench3
])
It seems like when I run this program, the results are printed onlu at the end when all the benchmarks are done. Is there a way to print the results as they come in? In other words, I want to be able to see the result of each BenchmarkResult
as soon as it is done.