chatty-0.7.0.0: 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

Instances

class Monad m => ChRandom m where Source

Typeclass for all monads that may provide random numbers

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