summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ghc/GhciMonad.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/ghc/GhciMonad.hs b/ghc/GhciMonad.hs
index 54e7e0c984..a4abe322d2 100644
--- a/ghc/GhciMonad.hs
+++ b/ghc/GhciMonad.hs
@@ -316,7 +316,12 @@ printTimes dflags allocs psecs
secs_str = showFFloat (Just 2) secs
putStrLn (showSDoc dflags (
parens (text (secs_str "") <+> text "secs" <> comma <+>
- text (show allocs) <+> text "bytes")))
+ text (separateThousands allocs) <+> text "bytes")))
+ where
+ separateThousands n = reverse . sep . reverse . show $ n
+ where sep n'
+ | length n' <= 3 = n'
+ | otherwise = take 3 n' ++ "," ++ sep (drop 3 n')
-----------------------------------------------------------------------------
-- reverting CAFs