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

Safe HaskellNone

System.Chatty.Misc

Description

Provides typeclasses for clocks and randomizer environments

Synopsis

Documentation

class (Functor m, Monad m) => ChClock m whereSource

Typeclass for all monads that know the time

Methods

mutctime :: m UTCTimeSource

Get UTC Time

mgetstamp :: m NominalDiffTimeSource

Get timestamp, guaranteed to grow

class Monad m => ChRandom m whereSource

Typeclass for all monads that may provide random numbers

Methods

mrandom :: Random r => m rSource

Get a single random number

mrandomR :: Random r => (r, r) -> m rSource

Get a single random number in the given range