Permalink
Browse files

Documentation fixes.

  • Loading branch information...
1 parent 13d53d6 commit 95d668d0ae8265b46b82ef56d4f99d1021572c84 @bjornbm committed Apr 9, 2011
Showing with 9 additions and 9 deletions.
  1. +9 −9 Data/Random/Normal.hs
View
@@ -23,17 +23,17 @@ Pure:
In the IO monad:
-> sample <- normalIO
-> samples <- normalsIO -- infinite list
+> sample <- normalIO
+> samples <- normalsIO -- infinite list
With custom mean and standard deviation:
-> sample = normal' (mean,sigma) myRandomGen
-> samples = normals' (mean,sigma) myRandomGen
-> samples2 = mkNormals' (mean,sigma) 10831452
+> (sample,g) = normal' (mean,sigma) myRandomGen
+> samples = normals' (mean,sigma) myRandomGen
+> samples2 = mkNormals' (mean,sigma) 10831452
-> sample <- normalIO' (mean,sigma)
-> samples <- normalsIO' (mean,sigma)
+> sample <- normalIO' (mean,sigma)
+> samples <- normalsIO' (mean,sigma)
Internally the library uses the Central Limit Theorem to approximate
normally distributed values from multiple uniformly distributed
@@ -93,7 +93,7 @@ normal g = (centralLimitTheorem as, g')
-- | Plural variant of 'normal', producing an infinite list of
-- random values instead of returning a new generator. This function
--- is ananalogous to 'System.Random.randoms'.
+-- is ananalogous to 'Random.randoms'.
normals :: (RandomGen g, Random a, Fractional a) => g -> [a]
normals g = x:normals g' where (x,g') = normal g
@@ -106,7 +106,7 @@ mkNormals = normals . mkStdGen
-- | A variant of 'normal' that uses the global random number
--- generator.
+-- generator. This function is analogous to 'Random.randomIO'.
normalIO :: (Random a, Fractional a) => IO a
normalIO = fmap centralLimitTheorem $ mapM randomRIO $ repeat (0,1)

0 comments on commit 95d668d

Please sign in to comment.