Package1.2.1.3System
random
Pseudo-random number generation
- Version1.2.1.3
- CategorySystem
- LicenceBSD-3-Clause
- Maintainercore-libraries-committee@haskell.org
- Pinned byhackage random 1.2.1.3
- Sourcehackage.haskell.org/package/random-1.2.1.3
Modules
3 modules- System.Random17This library deals with the common task of pseudo-random number generation.
- System.Random.Stateful49This library deals with the common task of pseudo-random number generation.
Internal modules · 1
- System.Random.Internal27This library deals with the common task of pseudo-random number generation.
Description
This package provides basic pseudo-random number generation, including the ability to split random number generators.
In pure code, use System.Random.uniform and System.Random.uniformR from System.Random to generate pseudo-random numbers with a pure pseudo-random number generator like System.Random.StdGen.
As an example, here is how you can simulate rolls of a six-sided die using System.Random.uniformR:
See System.Random for more details.
In monadic code, use System.Random.Stateful.uniformM and System.Random.Stateful.uniformRM from System.Random.Stateful to generate pseudo-random numbers with a monadic pseudo-random number generator, or using a monadic adapter.
As an example, here is how you can simulate rolls of a six-sided die using System.Random.Stateful.uniformRM:
The monadic adapter System.Random.Stateful.runStateGen_ is used here to lift the pure pseudo-random number generator pureGen into the System.Random.Stateful.StatefulGen context.
The monadic interface can also be used with existing monadic pseudo-random number generators. In this example, we use the one provided in the mwc-random package:
See System.Random.Stateful for more details.
Depends on
5 packages- base-4.20.2.0with GHC
- bytestring-0.12.2.0with GHC
- deepseq-1.5.0.0with GHC
- mtl-2.3.1with GHC
- splitmix-0.1.3.1in this set
Used by in this set · 53
- ChasingBottoms-1.3.1.16
- MonadRandom-0.6.2
- QuickCheck-2.15.0.1
- abstract-deque-0.3
- abstract-deque-tests-0.3
- authenticate-oauth-1.7
- cabal-install-3.12.1.0
- checkers-0.6.0
- dbus-1.4.1
- edit-distance-0.2.2.1
- foldl-1.4.18
- genvalidity-1.1.1.0
- genvalidity-bytestring-1.0.0.1
- genvalidity-text-1.0.0.1
- grapesy-1.1.1
- hedgehog-1.7
- hint-0.9.0.8
- hspec-core-2.11.14
- hspec-golden-aeson-0.9.0.0
- hspec-meta-2.11.14
- http-client-0.7.19
- http-common-0.8.3.4
- linear-1.22
- mersenne-random-pure64-0.2.2.0
- mime-mail-0.5.1
- monad-par-extras-0.3.3
- mwc-random-0.15.2.0
- numeric-prelude-0.4.4
- pcg-random-0.1.4.0
- persistent-test-2.13.1.3
- polysemy-zoo-0.8.2.0
- random-fu-0.3.0.1
- random-shuffle-0.0.4
- raven-haskell-0.1.4.1
- retry-0.9.3.1
- rvar-0.3.0.2
- selda-0.5.2.1
- shake-0.19.8
- snap-core-1.0.5.1
- statistics-0.16.3.0
- statistics-linreg-0.3
- streaming-commons-0.2.3.0
- sydtest-0.22.0.0
- tasty-quickcheck-0.11.1
- temporary-1.3
- test-framework-0.8.2.2
- test-framework-quickcheck2-0.3.0.6
- tf-random-0.5
- tidal-1.9.5
- uuid-1.3.16
- uuid-types-1.0.6
- websockets-0.13.0.0
- yesod-core-1.6.26.0