io-classes 1.2.0.0 → 1.3.0.0
raw patch · 3 files changed
+25/−3 lines, 3 filesdep ~base
Dependency ranges changed: base
Files
- CHANGELOG.md +12/−0
- io-classes.cabal +3/−3
- src/Control/Monad/Class/MonadTimer.hs +10/−0
CHANGELOG.md view
@@ -1,5 +1,16 @@ # Revsion history of io-classes +## next release++### Breaking changes++### Non-breaking changes++## 1.3.0.0++- `io-sim-1.3.0.0`.+* Support `ghc-9.8`.+ ## 1.2.0.0 ### Non-breaking changes@@ -8,6 +19,7 @@ an `MVar` in an underlying monad (if applicable). This is mainly useful for `io-sim`, since the underlying monad is `ST`. `IO` has no underlying monad, so the provided instance for `IO` defaults `inspectMVar` to `tryReadMVar`.+* Add some Haddock documentation to `MonadDelay` ## 1.1.0.0
io-classes.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: io-classes-version: 1.2.0.0+version: 1.3.0.0 synopsis: Type classes for concurrency with STM, ST and timing description: IO Monad class hierarchy compatible with@@ -15,7 +15,7 @@ build-type: Simple extra-doc-files: CHANGELOG.md README.md bug-reports: https://github.com/input-output-hk/io-sim/issues-tested-with: GHC == { 8.10, 9.2, 9.4, 9.6 }+tested-with: GHC == { 8.10, 9.2, 9.4, 9.6, 9.8 } source-repository head type: git@@ -89,7 +89,7 @@ TypeFamilyDependencies TypeOperators UndecidableInstances- build-depends: base >=4.9 && <4.19,+ build-depends: base >=4.9 && <4.20, array, async >=2.1, bytestring,
src/Control/Monad/Class/MonadTimer.hs view
@@ -4,6 +4,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} +-- | Provides classes to handle delays and timeouts. module Control.Monad.Class.MonadTimer ( MonadDelay (..) , MonadTimer (..)@@ -18,13 +19,22 @@ import qualified System.Timeout as IO +-- | A typeclass to delay current thread. class Monad m => MonadDelay m where++ -- | Suspends the current thread for a given number of microseconds+ -- (GHC only).+ --+ -- See `IO.threadDelay`. threadDelay :: Int -> m () +-- | A typeclass providing utilities for /timeouts/. class (MonadDelay m, MonadSTM m) => MonadTimer m where + -- | See `STM.registerDelay`. registerDelay :: Int -> m (TVar m Bool) + -- | See `IO.timeout`. timeout :: Int -> m a -> m (Maybe a) --