normaldistribution
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 /not/ 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 @Random@ module (more
recently @System.Random@).
Pure:
> (sample,g) = normal myRandomGen -- using a Random.RandomGen
> samples = normals myRandomGen -- infinite list
> samples2 = mkNormals 10831452 -- infinite list using a seed
In the IO monad:
> sample <- normalIO
> samples <- normalsIO -- infinite list
With custom mean and standard deviation:
> (sample,g) = normal' (mean,sigma) myRandomGen
> samples = normals' (mean,sigma) myRandomGen
> samples2 = mkNormals' (mean,sigma) 10831452
> sample <- normalIO' (mean,sigma)
> samples <- normalsIO' (mean,sigma)
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. 'normals') will be roughly twice as efficient
as repeatedly generating individual samples with e.g. 'normal'.
| version | uploaded | uploader | changes | |
|---|---|---|---|---|
| 1.1.0.3 | 2011-08-31 01:16 UTC | BjornBuckwalter | +4/−4 lines, 2 filesdep +randomdep −haskell98 | |
| 1.1.0.2 | 2011-08-30 09:44 UTC | BjornBuckwalter | +7/−7 lines, 2 filesdep ~haskell98 | |
| 1.1.0.1 | 2011-04-22 02:01 UTC | BjornBuckwalter | +2/−2 lines, 1 filesdep ~haskell98 | |
| 1.1 | 2011-04-09 13:07 UTC | BjornBuckwalter | +44/−40 lines, 2 files | |
| 1.0 | 2011-04-09 07:09 UTC | BjornBuckwalter | +246/−0 lines, 5 filesdep +basedep +haskell98setup-changed |
Dependencies of normaldistribution-1.1.0.3
base <5 4.22.0.0 → 4.22.1.0
| 2026-12-01 12:38 UTC | 4.22.1.0 | +388/−6 lines, 9 filesdep ~ghc-internalPVP: major bump suggested |
| 2025-12-19 11:52 UTC | 4.22.0.0 | +886/−215 lines, 28 filesdep ~ghc-internalPVP ok |
| 2026-03-27 12:26 UTC | 4.21.2.0 | +10/−3 lines, 4 filesdep ~ghc-internalPVP ok |
| 2025-12-27 10:31 UTC | 4.21.1.0 | +17/−5 lines, 4 filesdep ~ghc-internalPVP ok |
| 2024-12-16 09:24 UTC | 4.21.0.0 | +1170/−396 lines, 39 filesdep ~ghc-internalPVP ok |
showing 5 of 61 versions
random <2 1.3.0 → 1.3.1
| 2025-04-04 14:25 UTC | 1.3.1 | +15/−6 lines, 3 filesPVP ok |
| 2025-01-06 04:03 UTC | 1.3.0 | +2410/−538 lines, 16 filesdep +data-array-bytedep ~basedep ~transformersPVP ok |
| 2024-12-14 20:31 UTC | 1.2.1.3 | +22/−37 lines, 3 filesdep −doctestdep −mwc-randomdep −unliftiodep ~basedep ~containersdep ~primitivePVP ok |
| 2024-02-04 16:26 UTC | 1.2.1.2 | +17/−12 lines, 2 filesdep ~doctestdep ~tastyPVP: major bump suggested |
| 2022-05-09 02:32 UTC | 1.2.1.1 | +8/−9 lines, 3 filesdep −ghc-byteorderdep ~bytestringdep ~doctestdep ~mtlPVP ok |
showing 5 of 15 versions
Reverse dependencies
9 packages depend on normaldistribution