MonadRandom-0.1.0: Random-number generation monad.ContentsIndex
Control.Monad.Random.Class
Portabilitynon-portable (multi-parameter type classes, undecidable instances)
Stabilityexperimental
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 Rand and monads created using RandT.

Synopsis
class Monad m => MonadRandom m where
getRandom :: Random a => m a
getRandoms :: Random a => m [a]
getRandomR :: Random a => (a, a) -> m a
getRandomRs :: Random a => (a, a) -> m [a]
getRandom :: (MonadRandom m, Random a) => m a
getRandomR :: (MonadRandom m, Random a) => (a, a) -> m a
getRandoms :: (MonadRandom m, Random a) => m [a]
getRandomRs :: (MonadRandom m, Random a) => (a, a) -> m [a]
Documentation
class Monad m => MonadRandom m where
An interface to random number generation monads.
Methods
getRandom :: Random a => m a
Return a randomly-selected value of type a. See random for details.
getRandoms :: Random a => m [a]
Return an infinite stream of random values of type a. See randoms for details.
getRandomR :: Random a => (a, a) -> m a
Return a randomly-selected value of type a in the range (lo,hi). See randomR for details.
getRandomRs :: Random a => (a, a) -> m [a]
Return an infinite stream of randomly-selected value of type a in the range (lo,hi). See randomRs for details.
show/hide Instances
getRandom :: (MonadRandom m, Random a) => m a
Return a randomly-selected value of type a. See random for details.
getRandomR :: (MonadRandom m, Random a) => (a, a) -> m a
Return a randomly-selected value of type a in the range (lo,hi). See randomR for details.
getRandoms :: (MonadRandom m, Random a) => m [a]
Return an infinite stream of random values of type a. See randoms for details.
getRandomRs :: (MonadRandom m, Random a) => (a, a) -> m [a]
Return an infinite stream of randomly-selected value of type a in the range (lo,hi). See randomRs for details.
Produced by Haddock version 0.8