From 98bef4db89b57b01c8f557a027dbeb8ae72407c9 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Mon, 25 Oct 2010 15:12:36 +0000 Subject: [PATCH] Use new showMultiLineString to fix Trac #4436 There is an accompanying patch for libraries base template-haskell --- compiler/utils/Outputable.lhs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/compiler/utils/Outputable.lhs b/compiler/utils/Outputable.lhs index ed02ab6..37f116c 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 -- 1.7.10.4