chatty-0.7.0.1: Some monad transformers and typeclasses for abstraction of global dependencies.

Safe HaskellSafe
LanguageHaskell2010

System.Chatty.Misc

Description

Provides typeclasses for clocks and randomizer environments

Synopsis

Documentation

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

class Monad m => ChRandom m where Source #

Typeclass for all monads that may provide random numbers

Minimal complete definition

mrandom, mrandomR

Methods

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

Instances

ChRandom IO Source # 

Methods

mrandom :: Random r => IO r Source #

mrandomR :: Random r => (r, r) -> IO r Source #