File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ module Control.Monad.IOSim (
41
41
import Prelude
42
42
43
43
import Data.Dynamic (fromDynamic )
44
+ import Data.List (intercalate )
44
45
import Data.Typeable (Typeable )
45
46
46
47
import Control.Exception (throw )
@@ -111,7 +112,14 @@ data Failure =
111
112
| FailureSloppyShutdown [LabeledThread ]
112
113
deriving Show
113
114
114
- instance Exception Failure
115
+ instance Exception Failure where
116
+ displayException (FailureException err) = displayException err
117
+ displayException FailureDeadlock = " <<io-sim deadlock>>"
118
+ displayException (FailureSloppyShutdown threads) =
119
+ concat [ " <<io-sim sloppy shutdown: "
120
+ , intercalate " ," (show `map` threads)
121
+ , " >>"
122
+ ]
115
123
116
124
-- | 'IOSim' is a pure monad.
117
125
--
You can’t perform that action at this time.
0 commit comments