summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-07-23 09:17:33 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2012-07-23 09:17:33 +0100
commitfabb1551411701338e737c741300bdd47ad11f9c (patch)
treefb99cd7b161ac43f972b3ff230e607b93626e7d3
parent79062a8a0e9168b7f925c05699c30333563a9303 (diff)
downloadhaskell-fabb1551411701338e737c741300bdd47ad11f9c.tar.gz
Delay inlining 'text' so that the RULE has a chance to fire
-rw-r--r--compiler/utils/Pretty.lhs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/utils/Pretty.lhs b/compiler/utils/Pretty.lhs
index 5d5dec1494..e4f748a05d 100644
--- a/compiler/utils/Pretty.lhs
+++ b/compiler/utils/Pretty.lhs
@@ -555,7 +555,10 @@ isEmpty Empty = True
isEmpty _ = False
char c = textBeside_ (Chr c) (_ILIT(1)) Empty
+
text s = case iUnbox (length s) of {sl -> textBeside_ (Str s) sl Empty}
+{-# NOINLINE [1] text #-} -- Give the RULE a chance to fire
+
ftext :: FastString -> Doc
ftext s = case iUnbox (lengthFS s) of {sl -> textBeside_ (PStr s) sl Empty}
ptext :: LitString -> Doc