Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Provides classes to handle delays and timeouts.
Synopsis
- class Monad m => MonadDelay m where
- threadDelay :: Int -> m ()
- class (MonadDelay m, MonadSTM m) => MonadTimer m where
Documentation
class Monad m => MonadDelay m where Source #
A typeclass to delay current thread.
threadDelay :: Int -> m () Source #
Suspends the current thread for a given number of microseconds (GHC only).
See threadDelay
.
Instances
MonadDelay IO Source # | |
Defined in Control.Monad.Class.MonadTimer threadDelay :: Int -> IO () Source # | |
MonadDelay m => MonadDelay (ReaderT r m) Source # | |
Defined in Control.Monad.Class.MonadTimer threadDelay :: Int -> ReaderT r m () Source # |
class (MonadDelay m, MonadSTM m) => MonadTimer m where Source #
A typeclass providing utilities for timeouts.
registerDelay :: Int -> m (TVar m Bool) Source #
See registerDelay
.
timeout :: Int -> m a -> m (Maybe a) Source #
See timeout
.
Instances
MonadTimer IO Source # | |
MonadTimer m => MonadTimer (ReaderT r m) Source # | |