|
Control.Monad.Random.Class | Portability | non-portable (multi-parameter type classes, undecidable instances) | Stability | experimental |
|
|
|
|
|
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 |
|
|
|
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.
|
| | 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 |