io-classes-1.1.0.0: Type classes for concurrency with STM, ST and timing
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Monad.Class.MonadTimer

Documentation

class Monad m => MonadDelay m where Source #

Methods

threadDelay :: Int -> m () Source #

Instances

Instances details
MonadDelay IO Source #

With threadDelay one can use arbitrary large DiffTimes, which is an advantage over threadDelay.

Instance details

Defined in Control.Monad.Class.MonadTimer

Methods

threadDelay :: Int -> IO () Source #

MonadDelay m => MonadDelay (ReaderT r m) Source # 
Instance details

Defined in Control.Monad.Class.MonadTimer

Methods

threadDelay :: Int -> ReaderT r m () Source #

class (MonadDelay m, MonadSTM m) => MonadTimer m where Source #

Methods

registerDelay :: Int -> m (TVar m Bool) Source #

timeout :: Int -> m a -> m (Maybe a) Source #

Instances

Instances details
MonadTimer IO Source # 
Instance details

Defined in Control.Monad.Class.MonadTimer

Methods

registerDelay :: Int -> IO (TVar IO Bool) Source #

timeout :: Int -> IO a -> IO (Maybe a) Source #

MonadTimer m => MonadTimer (ReaderT r m) Source # 
Instance details

Defined in Control.Monad.Class.MonadTimer

Methods

registerDelay :: Int -> ReaderT r m (TVar (ReaderT r m) Bool) Source #

timeout :: Int -> ReaderT r m a -> ReaderT r m (Maybe a) Source #