File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ module Control.Monad.IOSim
39
39
, ppTrace_
40
40
, ppEvents
41
41
, ppSimEvent
42
+ , ppDebug
42
43
-- ** Selectors
43
44
, traceEvents
44
45
, traceResult
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ module Control.Monad.IOSim.Types
58
58
, ppTrace
59
59
, ppTrace_
60
60
, ppSimEvent
61
+ , ppDebug
61
62
, TraceEvent
62
63
, Labelled (.. )
63
64
@@ -624,6 +625,14 @@ ppTrace_ tr = Trace.ppTrace
624
625
(ppSimEvent (bimaximum (bimap (const 0 ) (maybe 0 length . seThreadLabel') tr)))
625
626
tr
626
627
628
+ -- | Trace each event using 'Debug.trace'; this is useful when a trace ends with
629
+ -- a pure error, e.g. an assertion.
630
+ --
631
+ ppDebug :: SimTrace a -> x -> x
632
+ ppDebug = appEndo
633
+ . foldMap (Endo . Debug. trace . show )
634
+ . Trace. toList
635
+
627
636
pattern Trace :: Time -> ThreadId -> Maybe ThreadLabel -> SimEventType -> SimTrace a
628
637
-> SimTrace a
629
638
pattern Trace time threadId threadLabel traceEvent trace =
You can’t perform that action at this time.
0 commit comments