File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 1
1
# Revsion history of io-sim
2
2
3
+ ## next version
4
+
5
+ ### Non breaking changes
6
+
7
+ * Provide ` MonadInspectMVar ` instance for ` IOSim ` .
8
+
3
9
## 1.1.0.0
4
10
5
11
### Non breaking changes
Original file line number Diff line number Diff line change @@ -567,6 +567,14 @@ instance MonadMVar (IOSim s) where
567
567
tryReadMVar = tryReadMVarDefault
568
568
isEmptyMVar = isEmptyMVarDefault
569
569
570
+ instance MonadInspectMVar (IOSim s ) where
571
+ type InspectMVarMonad (IOSim s ) = ST s
572
+ inspectMVar p (MVar tvar) = do
573
+ st <- inspectTVar p tvar
574
+ case st of
575
+ MVarEmpty _ _ -> pure Nothing
576
+ MVarFull x _ -> pure (Just x)
577
+
570
578
data Async s a = Async ! ThreadId (STM s (Either SomeException a ))
571
579
572
580
instance Eq (Async s a ) where
You can’t perform that action at this time.
0 commit comments