X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Futils%2FOutputable.lhs;h=ef856d0f54d0e49b25f56cd2db793e5f47243651;hb=5cdd6d82bb1a4c4b90ea2488dcf1fef25c3cc9a4;hp=d6016b0a723bfa2af519f85ea9137f81942898c9;hpb=8bbebfe661bdc976965718a2a489515c4929a03f;p=ghc-hetmet.git diff --git a/compiler/utils/Outputable.lhs b/compiler/utils/Outputable.lhs index d6016b0..ef856d0 100644 --- a/compiler/utils/Outputable.lhs +++ b/compiler/utils/Outputable.lhs @@ -45,9 +45,9 @@ module Outputable ( pprHsChar, pprHsString, -- error handling - pprPanic, assertPprPanic, pprPanic#, pprPgmError, + pprPanic, assertPprPanic, pprPanicFastInt, pprPgmError, pprTrace, warnPprTrace, - trace, pgmError, panic, panic#, assertPanic + trace, pgmError, panic, panicFastInt, assertPanic ) where #include "HsVersions.h" @@ -59,7 +59,6 @@ import {-# SOURCE #-} OccName( OccName ) import StaticFlags ( opt_PprStyle_Debug, opt_PprUserLength ) import FastString import FastTypes -import GHC.Ptr import qualified Pretty import Pretty ( Doc, Mode(..) ) import Panic @@ -336,7 +335,7 @@ empty :: SDoc text :: String -> SDoc char :: Char -> SDoc ftext :: FastString -> SDoc -ptext :: Ptr t -> SDoc +ptext :: LitString -> SDoc int :: Int -> SDoc integer :: Integer -> SDoc float :: Float -> SDoc @@ -472,11 +471,20 @@ instance (Outputable a, Outputable b, Outputable c) => Outputable (a, b, c) wher instance (Outputable a, Outputable b, Outputable c, Outputable d) => Outputable (a, b, c, d) where - ppr (x,y,z,w) = - parens (sep [ppr x <> comma, - ppr y <> comma, - ppr z <> comma, - ppr w]) + ppr (a,b,c,d) = + parens (sep [ppr a <> comma, + ppr b <> comma, + ppr c <> comma, + ppr d]) + +instance (Outputable a, Outputable b, Outputable c, Outputable d, Outputable e) => + Outputable (a, b, c, d, e) where + ppr (a,b,c,d,e) = + parens (sep [ppr a <> comma, + ppr b <> comma, + ppr c <> comma, + ppr d <> comma, + ppr e]) instance Outputable FastString where ppr fs = ftext fs -- Prints an unadorned string, @@ -616,8 +624,8 @@ pprPgmError = pprAndThen pgmError -- Throw an exn saying "bug in pgm being compi -- (used for unusual pgm errors) pprTrace = pprAndThen trace -pprPanic# :: String -> SDoc -> FastInt -pprPanic# heading pretty_msg = panic# (show (doc PprDebug)) +pprPanicFastInt :: String -> SDoc -> FastInt +pprPanicFastInt heading pretty_msg = panicFastInt (show (doc PprDebug)) where doc = text heading <+> pretty_msg