chatty-0.7.0.1: Some monad transformers and typeclasses for abstraction of global dependencies.
System.Chatty.Misc
Description
Provides typeclasses for clocks and randomizer environments
Synopsis
class (Functor m, Monad m) => ChClock m where Source #
Typeclass for all monads that know the time
Minimal complete definition
mutctime
Methods
mutctime :: m UTCTime Source #
Get UTC Time
mgetstamp :: m NominalDiffTime Source #
Get timestamp, guaranteed to grow
Instances
mutctime :: IO UTCTime Source #
mgetstamp :: IO NominalDiffTime Source #
class Monad m => ChRandom m where Source #
Typeclass for all monads that may provide random numbers
mrandom, mrandomR
mrandom :: Random r => m r Source #
Get a single random number
mrandomR :: Random r => (r, r) -> m r Source #
Get a single random number in the given range
mrandom :: Random r => IO r Source #
mrandomR :: Random r => (r, r) -> IO r Source #