MonadRandom-0.1.1: Random-number generation monad.

Portabilitynon-portable (multi-parameter type classes, undecidable instances)
Stabilityexperimental

Control.Monad.Random.Class

Description

A type class for random number generation monads. See http://www.haskell.org/haskellwiki/NewMonads/MonadRandom for the original version of this code.

Instances of this type class include Control.Monad.Random.Rand and monads created using Control.Monad.Random.RandT.

Synopsis

Documentation

class Monad m => MonadRandom m whereSource

An interface to random number generation monads.

Methods

getRandom :: Random a => m aSource

Return a randomly-selected value of type a. See random for details.

getRandoms :: Random a => m [a]Source

Return an infinite stream of random values of type a. See randoms for details.

getRandomR :: Random a => (a, a) -> m aSource

Return a randomly-selected value of type a in the range (lo,hi). See randomR for details.

getRandomRs :: Random a => (a, a) -> m [a]Source

Return an infinite stream of randomly-selected value of type a in the range (lo,hi). See randomRs for details.