diff --git a/io-sim/CHANGELOG.md b/io-sim/CHANGELOG.md index aa88e92d..1665d8f9 100644 --- a/io-sim/CHANGELOG.md +++ b/io-sim/CHANGELOG.md @@ -6,6 +6,7 @@ ### Non-breaking changes +* Added `ppSayTrace` which pritty prints `EventSay` which are coming from `say` usage. * Repository moved to https://github.com/IntersectMBO/io-sim ## 1.10.1.0 diff --git a/io-sim/src/Control/Monad/IOSim.hs b/io-sim/src/Control/Monad/IOSim.hs index 6005c432..cb9358f1 100644 --- a/io-sim/src/Control/Monad/IOSim.hs +++ b/io-sim/src/Control/Monad/IOSim.hs @@ -58,6 +58,7 @@ module Control.Monad.IOSim -- ** Pretty printers , ppTrace , ppTrace_ + , ppSayTrace , ppEvents , ppSimEvent , ppDebug @@ -486,6 +487,16 @@ ppEvents events = ] +-- | Filter `EventSay` and pretty print them. +-- +ppSayTrace :: SimTrace a -> String +ppSayTrace tr = ppEvents + [ a + | a@(_, _, _, EventSay {}) + <- traceEvents tr + ] + + -- | See 'runSimTraceST' below. -- runSimTrace :: forall a. (forall s. IOSim s a) -> SimTrace a