From: simonpj@microsoft.com Date: Mon, 25 Oct 2010 15:12:36 +0000 (+0000) Subject: Use new showMultiLineString to fix Trac #4436 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=98bef4db89b57b01c8f557a027dbeb8ae72407c9 Use new showMultiLineString to fix Trac #4436 There is an accompanying patch for libraries base template-haskell --- 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