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"
import StaticFlags ( opt_PprStyle_Debug, opt_PprUserLength )
import FastString
import FastTypes
-import GHC.Ptr
import qualified Pretty
import Pretty ( Doc, Mode(..) )
import Panic
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
instance Outputable Int where
ppr n = int n
+instance Outputable Word32 where
+ ppr n = integer $ fromIntegral n
+
instance Outputable () where
ppr _ = text "()"
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,
-- (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