-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Minimum fuss normally distributed random values.
--   
--   This purpose of this library is to have a simple API and no
--   dependencies beyond Haskell 98 in order to let you produce normally
--   distributed random values with a minimum of fuss. This library does
--   <i>not</i> attempt to be blazingly fast nor to pass stringent tests of
--   randomness. It attempts to be very easy to install and use while being
--   "good enough" for many applications (simulations, games, etc.). The
--   API builds upon and is largely analogous to that of the Haskell 98
--   <tt>Random</tt> module (more recently <tt>System.Random</tt>).
--   
--   Pure:
--   
--   <pre>
--   (sample,g) = normal  myRandomGen  -- using a Random.RandomGen
--   samples    = normals myRandomGen  -- infinite list
--   samples2   = mkNormals 10831452   -- infinite list using a seed
--   </pre>
--   
--   In the IO monad:
--   
--   <pre>
--   sample    &lt;- normalIO
--   samples   &lt;- normalsIO  -- infinite list
--   </pre>
--   
--   With custom mean and standard deviation:
--   
--   <pre>
--   (sample,g) = normal'    (mean,sigma) myRandomGen
--   samples    = normals'   (mean,sigma) myRandomGen
--   samples2   = mkNormals' (mean,sigma) 10831452
--   </pre>
--   
--   <pre>
--   sample    &lt;- normalIO'  (mean,sigma)
--   samples   &lt;- normalsIO' (mean,sigma)
--   </pre>
--   
--   Internally the library uses the Box-Muller method to generate normally
--   distributed values from uniformly distributed random values. If more
--   than one sample is needed taking samples off an infinite list (created
--   by e.g. <a>normals</a>) will be roughly twice as efficient as
--   repeatedly generating individual samples with e.g. <a>normal</a>.
@package normaldistribution
@version 1.1.0.3


-- | This purpose of this library is to have a simple API and no
--   dependencies beyond Haskell 98 in order to let you produce normally
--   distributed random values with a minimum of fuss. This library does
--   <i>not</i> attempt to be blazingly fast nor to pass stringent tests of
--   randomness. It attempts to be very easy to install and use while being
--   "good enough" for many applications (simulations, games, etc.). The
--   API builds upon and is largely analogous to that of the Haskell 98
--   <tt>Random</tt> module (more recently <tt>System.Random</tt>).
--   
--   Pure:
--   
--   <pre>
--   (sample,g) = normal  myRandomGen  -- using a Random.RandomGen
--   samples    = normals myRandomGen  -- infinite list
--   samples2   = mkNormals 10831452   -- infinite list using a seed
--   </pre>
--   
--   In the IO monad:
--   
--   <pre>
--   sample    &lt;- normalIO
--   samples   &lt;- normalsIO  -- infinite list
--   </pre>
--   
--   With custom mean and standard deviation:
--   
--   <pre>
--   (sample,g) = normal'    (mean,sigma) myRandomGen
--   samples    = normals'   (mean,sigma) myRandomGen
--   samples2   = mkNormals' (mean,sigma) 10831452
--   </pre>
--   
--   <pre>
--   sample    &lt;- normalIO'  (mean,sigma)
--   samples   &lt;- normalsIO' (mean,sigma)
--   </pre>
--   
--   Internally the library uses the Box-Muller method to generate normally
--   distributed values from uniformly distributed random values. If more
--   than one sample is needed taking samples off an infinite list (created
--   by e.g. <a>normals</a>) will be roughly twice as efficient as
--   repeatedly generating individual samples with e.g. <a>normal</a>.
module Data.Random.Normal

-- | Takes a random number generator g, and returns a random value normally
--   distributed with mean 0 and standard deviation 1, together with a new
--   generator. This function is analogous to <a>random</a>.
normal :: (RandomGen g, Random a, Floating a) => g -> (a, g)

-- | Plural variant of <a>normal</a>, producing an infinite list of random
--   values instead of returning a new generator. This function is
--   analogous to <a>randoms</a>.
normals :: (RandomGen g, Random a, Floating a) => g -> [a]

-- | Creates a infinite list of normally distributed random values from the
--   provided random generator seed. (In the implementation the seed is fed
--   to <a>mkStdGen</a> to produce the random number generator.)
mkNormals :: (Random a, Floating a) => Int -> [a]

-- | Analogous to <a>normal</a> but uses the supplied (mean, standard
--   deviation).
normal' :: (RandomGen g, Random a, Floating a) => (a, a) -> g -> (a, g)

-- | Analogous to <a>normals</a> but uses the supplied (mean, standard
--   deviation).
normals' :: (RandomGen g, Random a, Floating a) => (a, a) -> g -> [a]

-- | Analogous to <a>mkNormals</a> but uses the supplied (mean, standard
--   deviation).
mkNormals' :: (Random a, Floating a) => (a, a) -> Int -> [a]

-- | A variant of <a>normal</a> that uses the global random number
--   generator. This function is analogous to <a>randomIO</a>.
normalIO :: (Random a, Floating a) => IO a

-- | Creates a infinite list of normally distributed random values using
--   the global random number generator. (In the implementation
--   <a>newStdGen</a> is used.)
normalsIO :: (Random a, Floating a) => IO [a]

-- | Analogous to <a>normalIO</a> but uses the supplied (mean, standard
--   deviation).
normalIO' :: (Random a, Floating a) => (a, a) -> IO a

-- | Analogous to <a>normalsIO</a> but uses the supplied (mean, standard
--   deviation).
normalsIO' :: (Random a, Floating a) => (a, a) -> IO [a]
