ghc-9.2.8: The GHC API
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.Driver.Ppr

Contents

Description

Printing related functions that depend on session state (DynFlags)

Synopsis

Documentation

showSDoc :: DynFlags -> SDoc -> String Source #

Show a SDoc as a String with the default user style

showSDocForUser :: DynFlags -> UnitState -> PrintUnqualified -> SDoc -> String Source #

Allows caller to specify the PrintUnqualified to use

printForC :: DynFlags -> Handle -> SDoc -> IO () Source #

Like printSDocLn but specialized with LeftMode and PprCode CStyle. This is typically used to output C-- code.

Trace

warnPprTrace :: HasCallStack => Bool -> String -> Int -> SDoc -> a -> a Source #

Just warn about an assertion failure, recording the given file and line number. Should typically be accessed with the WARN macros

pprTrace :: String -> SDoc -> a -> a Source #

If debug output is on, show some SDoc on the screen

pprTraceWithFlags :: DynFlags -> String -> SDoc -> a -> a Source #

If debug output is on, show some SDoc on the screen

pprTraceDebug :: String -> SDoc -> a -> a Source #

pprTraceIt :: Outputable a => String -> a -> a Source #

pprTraceIt desc x is equivalent to pprTrace desc (ppr x) x

pprSTrace :: HasCallStack => SDoc -> a -> a Source #

If debug output is on, show some SDoc on the screen along with a call stack when available.

pprTraceException :: ExceptionMonad m => String -> SDoc -> m a -> m a Source #

pprTraceException desc x action runs action, printing a message if it throws an exception.