summaryrefslogtreecommitdiff
path: root/compiler/utils
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2010-10-25 15:12:36 +0000
committersimonpj@microsoft.com <unknown>2010-10-25 15:12:36 +0000
commit98bef4db89b57b01c8f557a027dbeb8ae72407c9 (patch)
tree1ded0d54790e3ebd2ee997e9e643b01c4238c4ae /compiler/utils
parent707ea5881703d680155aab268bdbf7edc113e3b1 (diff)
downloadhaskell-98bef4db89b57b01c8f557a027dbeb8ae72407c9.tar.gz
Use new showMultiLineString to fix Trac #4436
There is an accompanying patch for libraries base template-haskell
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/Outputable.lhs12
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/utils/Outputable.lhs b/compiler/utils/Outputable.lhs
index ed02ab6c8a..37f116cfe0 100644
--- a/compiler/utils/Outputable.lhs
+++ b/compiler/utils/Outputable.lhs
@@ -80,9 +80,19 @@ import qualified Data.IntMap as IM
import Data.Word
import System.IO ( Handle, stderr, stdout, hFlush )
import System.FilePath
+
+
+#if __GLASGOW_HASKELL__ >= 700
+import GHC.Show ( showMultiLineString )
+#else
+showMultiLineString :: String -> [String]
+-- Crude version
+showMultiLineString s = [s]
+#endif
\end{code}
+
%************************************************************************
%* *
\subsection{The @PprStyle@ data type}
@@ -608,7 +618,7 @@ pprHsChar c | c > '\x10ffff' = char '\\' <> text (show (fromIntegral (ord c) ::
-- | Special combinator for showing string literals.
pprHsString :: FastString -> SDoc
-pprHsString fs = text (show (unpackFS fs))
+pprHsString fs = vcat (map text (showMultiLineString (unpackFS fs)))
---------------------
-- Put a name in parens if it's an operator