| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Control.Monad.Class.MonadTimer
Description
Synopsis
- class Monad m => MonadDelay (m :: Type -> Type) where
- threadDelay :: Int -> m ()
- class (MonadDelay m, MonadSTM m) => MonadTimer (m :: Type -> Type) where
Documentation
class Monad m => MonadDelay (m :: Type -> Type) where Source #
A typeclass to delay current thread.
Methods
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 Methods threadDelay :: Int -> IO () Source # | |
| MonadDelay m => MonadDelay (ReaderT r m) Source # | |
Defined in Control.Monad.Class.MonadTimer Methods threadDelay :: Int -> ReaderT r m () Source # | |
class (MonadDelay m, MonadSTM m) => MonadTimer (m :: Type -> Type) where Source #
A typeclass providing utilities for timeouts.
Methods
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 # | |