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 #

Show a SDoc as a String with the default user style

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

Allows caller to specify the PrintUnqualified to use

pprDebugAndThen :: SDocContext -> (String -> a) -> SDoc -> SDoc -> a #

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

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 #

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 #

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

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

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

pprTraceM :: Applicative f => String -> SDoc -> f () #

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

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

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

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

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 #

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