Safe Haskell | None |
---|---|
Language | Haskell2010 |
An implementation of MonadTime
with a monad transformer.
Synopsis
- newtype SimulatedTimeT m a = SimulatedTimeT {
- unSimulatedTimeT :: ReaderT TimeEnv m a
- runSimulatedTimeT :: SimulatedTimeT m a -> TimeEnv -> m a
- newtype RealTimeT m a = RealTimeT {
- runRealTimeT :: m a
- getTimeEnv :: Monad m => SimulatedTimeT m TimeEnv
- module Test.SimulatedTime
Documentation
newtype SimulatedTimeT m a Source #
Instances
runSimulatedTimeT :: SimulatedTimeT m a -> TimeEnv -> m a Source #
Run the reader
newtype RealTimeT m a Source #
An implementation for MonadTime
that uses real time directly,
not allowing for control. Use it from code where you need to choose
implementation for MockTime, but don't need to control the time.
Example: use this one in the executable, while SimulatedTimeT
is
used in tests that need to control time.
RealTimeT | |
|
Instances
getTimeEnv :: Monad m => SimulatedTimeT m TimeEnv Source #
module Test.SimulatedTime