Commits

Bryan O'Sullivan committed eb5f545

Fix various English language issues

Comments (0)

Files changed (2)

System/Random/MWC.hs

 
 -- This is workaround for bug #25.
 --
--- GHC-7.6 have bug (#8072) which results in calculation of wrongs
--- number of buckets in function `uniformRange'. Consequently unformR
+-- GHC-7.6 has a bug (#8072) which results in calculation of wrong
+-- number of buckets in function `uniformRange'. Consequently uniformR
 -- generates values in wrong range.
 --
 -- Bug only affects 32-bit systems and Int/Word data types. Word32

System/Random/MWC/Distributions.hs

 --
 -- Pseudo-random number generation for non-uniform distributions.
 
-module System.Random.MWC.Distributions 
+module System.Random.MWC.Distributions
     (
     -- * Variates: non-uniformly distributed values
       normal
   | otherwise = do x <- gamma (0.5 * fromIntegral n) 1 gen
                    return $! 2 * x
 
--- | Random variate generator for geometrical distribution for number
---   of failures before success. Have support [0..]
+-- | Random variate generator for the geometric distribution,
+-- computing the number of failures before success. Supports [0..].
 geometric0 :: PrimMonad m
            => Double            -- ^ /p/ success probability lies in (0,1]
            -> Gen (PrimState m) -- ^ Generator
                          -- FIXME: We want to use log1p here but it will
                          --        introduce dependency on math-functions.
                          return $! floor $ log q / log (1 - p)
-  | otherwise       = pkgError "geometrical" "probability out of [0,1] range"
+  | otherwise       = pkgError "geometric0" "probability out of [0,1] range"
 
--- | Random variate generator for geometrical distribution for number
---   of trials. Have support [1..]  it's just 'geometrical0' shifted by 1.
+-- | Random variate generator for geometric distribution for number of
+-- trials. Supports [1..] (i.e. just 'geometric0' shifted by 1).
 geometric1 :: PrimMonad m
            => Double            -- ^ /p/ success probability lies in (0,1]
            -> Gen (PrimState m) -- ^ Generator
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.