import Panic
import Data.Char
-import Data.Map (Map)
import qualified Data.Map as M
+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}
ppr fs = ftext fs -- Prints an unadorned string,
-- no double quotes or anything
-instance (Outputable key, Outputable elt) => Outputable (Map key elt) where
+instance (Outputable key, Outputable elt) => Outputable (M.Map key elt) where
ppr m = ppr (M.toList m)
+instance (Outputable elt) => Outputable (IM.IntMap elt) where
+ ppr m = ppr (IM.toList m)
\end{code}
%************************************************************************
-- | 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