Skip to content

Commit 763fe77

Browse files
authored
Merge pull request #118 from input-output-hk/coot/traceDebugLog
Use ppSimResult in traceDebugLog
2 parents 1b5f5cc + a4e6d19 commit 763fe77

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

io-sim/CHANGELOG.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
* `MainReturn`, `MainException` and the pattern synonyms `TraceMainReturn`,
88
`TraceMainException` changed their signature. They will now also show the main thread id.
9-
10-
#### Breaking changes
11-
129
* Renamed `ThreadId` to `IOSimThreadId` to avoid a clash with `ThreadId`
1310
associated type family of `MonadFork`. It makes it much simpler to paste
1411
failing `ScheduleControl` in `ghci` or tests.
@@ -17,7 +14,6 @@
1714
a constructor for internal failures. This improved error reporting when
1815
there's a bug in `IOSimPOR`. Currently it's only used by some of the
1916
assertions in `IOSimPOR`.
20-
* added pretty printer for `SimResult`, and other pretty printer improvements.
2117

2218
#### Non breaking changes
2319

@@ -37,6 +33,7 @@
3733
* Reimplemented `labelTVarIO` and `traceTVarIO` in `ST` monad, which simplifies
3834
trace of these calls.
3935
* Fixed `traceTVar` for `TVar`'s created with `registerDelay`.
36+
* Added pretty printer for `SimResult`, and other pretty printer improvements.
4037

4138
## 1.2.0.0
4239

io-sim/src/Control/Monad/IOSim.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,9 +639,9 @@ exploreSimTraceST optsf main k =
639639
traceDebugLog :: Int -> SimTrace a -> ST s ()
640640
traceDebugLog logLevel _trace | logLevel <= 0 = pure ()
641641
traceDebugLog 1 trace = Debug.traceM $ "Simulation trace with discovered schedules:\n"
642-
++ Trace.ppTrace show (ppSimEvent 0 0 0) (ignoreRaces $ void `first` trace)
642+
++ Trace.ppTrace (ppSimResult 0 0 0) (ppSimEvent 0 0 0) (ignoreRaces $ void `first` trace)
643643
traceDebugLog _ trace = Debug.traceM $ "Simulation trace with discovered schedules:\n"
644-
++ Trace.ppTrace show (ppSimEvent 0 0 0) (void `first` trace)
644+
++ Trace.ppTrace (ppSimResult 0 0 0) (ppSimEvent 0 0 0) (void `first` trace)
645645

646646

647647
-- | Run a simulation using a given schedule. This is useful to reproduce

io-sim/src/Control/Monad/IOSim/Types.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ module Control.Monad.IOSim.Types
4949
, ppSimEventType
5050
, SimEvent (..)
5151
, SimResult (..)
52+
, ppSimResult
5253
, SimTrace
5354
, Trace.Trace (SimTrace, SimPORTrace, TraceMainReturn, TraceMainException, TraceDeadlock, TraceRacesFound, TraceLoop, TraceInternalError)
5455
, ppTrace

0 commit comments

Comments
 (0)