io-classes-mtl 0.1.1.0 → 0.1.2.0
raw patch · 4 files changed
+51/−5 lines, 4 filesdep ~basedep ~io-classesnew-uploaderPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, io-classes
API changes (from Hackage documentation)
Files
- CHANGELOG.md +8/−1
- io-classes-mtl.cabal +4/−4
- src/Control/Monad/Class/MonadSTM/Trans.hs +15/−0
- src/Control/Monad/Class/MonadThrow/Trans.hs +24/−0
CHANGELOG.md view
@@ -1,8 +1,15 @@ # Revision history for io-classes-mtl +## 0.1.2.0++### Non breaking changes++* Added `writeTMVar` to `MonadSTM` instances.+* Support `io-classes-1.5.0.0`.+ ## 0.1.1.0 -* Support `io-classes-1.4.1.0`+* Support `io-classes-1.4.1.0`. ## 0.1.0.2
io-classes-mtl.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: io-classes-mtl-version: 0.1.1.0+version: 0.1.2.0 synopsis: Experimental MTL instances for io-classes description: MTL instances for@@ -15,7 +15,7 @@ build-type: Simple extra-doc-files: README.md CHANGELOG.md bug-reports: https://github.com/input-output-hk/io-sim/issues-tested-with: GHC == { 8.10, 9.2, 9.4, 9.6, 9.8 }+tested-with: GHC == { 8.10, 9.2, 9.4, 9.6, 9.8, 9.10 } common warnings ghc-options: -Wall@@ -40,11 +40,11 @@ , Control.Monad.Class.MonadTime.SI.Trans , Control.Monad.Class.MonadTimer.Trans , Control.Monad.Class.MonadTimer.SI.Trans- build-depends: base >=4.9 && <4.20,+ build-depends: base >=4.9 && <4.21, array, mtl, - io-classes ^>=1.4.1.0,+ io-classes ^>=1.4.1.0 || ^>=1.5, si-timers,
src/Control/Monad/Class/MonadSTM/Trans.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-}@@ -51,6 +52,9 @@ getNumElements = ContTSTM . getNumElements unsafeRead arr = ContTSTM . unsafeRead arr unsafeWrite arr i = ContTSTM . unsafeWrite arr i+#if __GLASGOW_HASKELL__ >= 910+ newArray idxs = ContTSTM . newArray idxs+#endif -- note: this (and the following) instance requires 'UndecidableInstances'@@ -64,6 +68,9 @@ , MonadThrow.MonadCatch (STM m) ) => MonadThrow.MonadThrow (ContTSTM r m) where throwIO = ContTSTM . MonadThrow.throwIO+#if __GLASGOW_HASKELL__ >= 910+ annotateIO ann (ContTSTM stm) = ContTSTM (MonadThrow.annotateIO ann stm)+#endif instance ( MonadSTM m , MonadThrow.MonadThrow (STM m)@@ -106,6 +113,7 @@ readTMVar = ContTSTM . readTMVar tryReadTMVar = ContTSTM . tryReadTMVar swapTMVar = ContTSTM .: swapTMVar+ writeTMVar = ContTSTM .: writeTMVar isEmptyTMVar = ContTSTM . isEmptyTMVar type TQueue (ContT r m) = TQueue m@@ -183,6 +191,7 @@ readTMVar = lift . readTMVar tryReadTMVar = lift . tryReadTMVar swapTMVar = lift .: swapTMVar+ writeTMVar = lift .: writeTMVar isEmptyTMVar = lift . isEmptyTMVar type TQueue (Lazy.WriterT w m) = TQueue m@@ -260,6 +269,7 @@ readTMVar = lift . readTMVar tryReadTMVar = lift . tryReadTMVar swapTMVar = lift .: swapTMVar+ writeTMVar = lift .: writeTMVar isEmptyTMVar = lift . isEmptyTMVar type TQueue (Strict.WriterT w m) = TQueue m@@ -337,6 +347,7 @@ readTMVar = lift . readTMVar tryReadTMVar = lift . tryReadTMVar swapTMVar = lift .: swapTMVar+ writeTMVar = lift .: writeTMVar isEmptyTMVar = lift . isEmptyTMVar type TQueue (Lazy.StateT s m) = TQueue m@@ -414,6 +425,7 @@ readTMVar = lift . readTMVar tryReadTMVar = lift . tryReadTMVar swapTMVar = lift .: swapTMVar+ writeTMVar = lift .: writeTMVar isEmptyTMVar = lift . isEmptyTMVar type TQueue (Strict.StateT s m) = TQueue m@@ -491,6 +503,7 @@ readTMVar = lift . readTMVar tryReadTMVar = lift . tryReadTMVar swapTMVar = lift .: swapTMVar+ writeTMVar = lift .: writeTMVar isEmptyTMVar = lift . isEmptyTMVar type TQueue (ExceptT e m) = TQueue m@@ -568,6 +581,7 @@ readTMVar = lift . readTMVar tryReadTMVar = lift . tryReadTMVar swapTMVar = lift .: swapTMVar+ writeTMVar = lift .: writeTMVar isEmptyTMVar = lift . isEmptyTMVar type TQueue (Lazy.RWST r w s m) = TQueue m@@ -645,6 +659,7 @@ readTMVar = lift . readTMVar tryReadTMVar = lift . tryReadTMVar swapTMVar = lift .: swapTMVar+ writeTMVar = lift .: writeTMVar isEmptyTMVar = lift . isEmptyTMVar type TQueue (Strict.RWST r w s m) = TQueue m
src/Control/Monad/Class/MonadThrow/Trans.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE RankNTypes #-} {-# OPTIONS_GHC -Wno-orphans #-} module Control.Monad.Class.MonadThrow.Trans () where@@ -21,7 +22,11 @@ instance MonadCatch m => MonadThrow (ExceptT e m) where throwIO = lift . throwIO+#if __GLASGOW_HASKELL__ >= 910+ annotateIO ann (ExceptT io) = ExceptT (annotateIO ann io)+#endif + instance MonadCatch m => MonadCatch (ExceptT e m) where catch (ExceptT m) f = ExceptT $ catch m (runExceptT . f) @@ -63,6 +68,10 @@ instance (Monoid w, MonadCatch m) => MonadThrow (Lazy.WriterT w m) where throwIO = lift . throwIO +#if __GLASGOW_HASKELL__ >= 910+ annotateIO ann (Lazy.WriterT io) = Lazy.WriterT (annotateIO ann io)+#endif+ -- | @since 1.0.0.0 instance (Monoid w, MonadCatch m) => MonadCatch (Lazy.WriterT w m) where catch (Lazy.WriterT m) f = Lazy.WriterT $ catch m (Lazy.runWriterT . f)@@ -102,6 +111,9 @@ -- | @since 1.0.0.0 instance (Monoid w, MonadCatch m) => MonadThrow (Strict.WriterT w m) where throwIO = lift . throwIO+#if __GLASGOW_HASKELL__ >= 910+ annotateIO ann (Strict.WriterT io) = Strict.WriterT (annotateIO ann io)+#endif -- | @since 1.0.0.0 instance (Monoid w, MonadCatch m) => MonadCatch (Strict.WriterT w m) where@@ -143,6 +155,9 @@ -- | @since 1.0.0.0 instance (Monoid w, MonadCatch m) => MonadThrow (Lazy.RWST r w s m) where throwIO = lift . throwIO+#if __GLASGOW_HASKELL__ >= 910+ annotateIO ann (Lazy.RWST io) = Lazy.RWST (\r s -> annotateIO ann (io r s))+#endif -- | @since 1.0.0.0 instance (Monoid w, MonadCatch m) => MonadCatch (Lazy.RWST r w s m) where@@ -186,6 +201,9 @@ -- | @since 1.0.0.0 instance (Monoid w, MonadCatch m) => MonadThrow (Strict.RWST r w s m) where throwIO = lift . throwIO+#if __GLASGOW_HASKELL__ >= 910+ annotateIO ann (Strict.RWST io) = Strict.RWST (\r s -> annotateIO ann (io r s))+#endif -- | @since 1.0.0.0 instance (Monoid w, MonadCatch m) => MonadCatch (Strict.RWST r w s m) where@@ -229,6 +247,9 @@ -- | @since 1.0.0.0 instance MonadCatch m => MonadThrow (Lazy.StateT s m) where throwIO = lift . throwIO+#if __GLASGOW_HASKELL__ >= 910+ annotateIO ann (Lazy.StateT io) = Lazy.StateT (\s -> annotateIO ann (io s))+#endif -- | @since 1.0.0.0 instance MonadCatch m => MonadCatch (Lazy.StateT s m) where@@ -270,6 +291,9 @@ -- | @since 1.0.0.0 instance MonadCatch m => MonadThrow (Strict.StateT s m) where throwIO = lift . throwIO+#if __GLASGOW_HASKELL__ >= 910+ annotateIO ann (Strict.StateT io) = Strict.StateT (\s -> annotateIO ann (io s))+#endif -- | @since 1.0.0.0 instance MonadCatch m => MonadCatch (Strict.StateT s m) where