From cd411286201bf3d5662e841fbf0df30ef3e5e475 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Thu, 27 Nov 2008 06:29:46 +0000 Subject: [PATCH] left-justify arguments in benchmark summary --- tools/bench.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/bench.hs b/tools/bench.hs index c603a6a6a..91c5658e6 100644 --- a/tools/bench.hs +++ b/tools/bench.hs @@ -115,9 +115,11 @@ summarise tests exes results = do maketable :: [String] -> [String] -> [[[Float]]] -> Table String maketable rownames colnames results = Table rowhdrs colhdrs rows where - rowhdrs = Group NoLine $ map Header rownames + rowhdrs = Group NoLine $ map Header $ padright rownames colhdrs = Group SingleLine $ map Header colnames rows = map (map (showtime . minimum)) results + padright ss = map (printf (printf "%%-%ds" w)) ss + where w = maximum $ map length ss showtime = printf $ "%."++(show precision)++"f"