Commit 126b4125 authored by Andreas Klebinger's avatar Andreas Klebinger Committed by Ben Gamari

Add pprTraceM to Outputable as analog to traceM.

Test Plan: ci, using it in monadic code.

Reviewers: bgamari, mpickering

Reviewed By: mpickering

Subscribers: rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D4697
parent 3310f7f1
......@@ -82,7 +82,7 @@ module Outputable (
-- * Error handling and debugging utilities
pprPanic, pprSorry, assertPprPanic, pprPgmError,
pprTrace, pprTraceDebug, pprTraceIt, warnPprTrace, pprSTrace,
pprTraceException,
pprTraceException, pprTraceM,
trace, pgmError, panic, sorry, assertPanic,
pprDebugAndThen, callStackDoc,
) where
......@@ -1182,6 +1182,9 @@ pprTrace str doc x
| otherwise =
pprDebugAndThen unsafeGlobalDynFlags trace (text str) doc x
pprTraceM :: Applicative f => String -> SDoc -> f ()
pprTraceM str doc = pprTrace str doc (pure ())
-- | @pprTraceIt desc x@ is equivalent to @pprTrace desc (ppr x) x@
pprTraceIt :: Outputable a => String -> a -> a
pprTraceIt desc x = pprTrace desc (ppr x) x
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment