random-fu-0.0.2.1: Random number generationSource codeContentsIndex
Data.Random.Source
Synopsis
class Monad m => MonadRandom m where
getRandomByte :: m Word8
getRandomWord :: m Word64
getRandomDouble :: m Double
class Monad m => RandomSource m s where
getRandomByteFrom :: s -> m Word8
getRandomWordFrom :: s -> m Word64
getRandomDoubleFrom :: s -> m Double
Documentation
class Monad m => MonadRandom m whereSource

A typeclass for monads with a chosen source of entropy. For example, RVar is such a monad - the source from which it is (eventually) sampled is the only source from which a random variable is permitted to draw, so when directly requesting entropy for a random variable these functions are used.

The minimal definition is either getRandomByte or getRandomWord. getRandomDouble is defaulted in terms of getRandomWord.

Methods
getRandomByte :: m Word8Source
Get a random uniformly-distributed byte.
getRandomWord :: m Word64Source
Get a random Word64 uniformly-distributed over the full range of the type.
getRandomDouble :: m DoubleSource
Get a random Double uniformly-distributed over the interval [0,1)
show/hide Instances
class Monad m => RandomSource m s whereSource

A source of entropy which can be used in the given monad.

The minimal definition is either getRandomByteFrom or getRandomWordFrom. getRandomDoubleFrom is defaulted in terms of getRandomWordFrom

Methods
getRandomByteFrom :: s -> m Word8Source
Get a random uniformly-distributed byte.
getRandomWordFrom :: s -> m Word64Source
Get a random Word64 uniformly-distributed over the full range of the type.
getRandomDoubleFrom :: s -> m DoubleSource
Get a random Double uniformly-distributed over the interval [0,1)
show/hide Instances
Produced by Haddock version 2.4.2