File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
io-classes/src/Control/Monad/Class/MonadSTM Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1321,9 +1321,15 @@ deriving instance MonadSTM m => MonadPlus (WrappedSTM t r m)
1321
1321
1322
1322
instance ( Semigroup a , MonadSTM m ) => Semigroup (WrappedSTM t r m a ) where
1323
1323
a <> b = (<>) <$> a <*> b
1324
- instance ( Monoid a , MonadSTM m ) => Monoid (WrappedSTM t r m a ) where
1324
+ instance ( Monoid a , MonadSTM m ) => Monoid (WrappedSTM t r m a ) where
1325
1325
mempty = pure mempty
1326
1326
1327
+ instance ( MonadSTM m , MArray e a (STM m ) ) => MArray e a (WrappedSTM t r m ) where
1328
+ getBounds = WrappedSTM . getBounds
1329
+ getNumElements = WrappedSTM . getNumElements
1330
+ unsafeRead arr = WrappedSTM . unsafeRead arr
1331
+ unsafeWrite arr i = WrappedSTM . unsafeWrite arr i
1332
+
1327
1333
1328
1334
-- note: this (and the following) instance requires 'UndecidableInstances'
1329
1335
-- extension because it violates 3rd Paterson condition, however `STM m` will
You can’t perform that action at this time.
0 commit comments