Package1.3.1System
random
Pseudo-random number generation
- Version1.3.1
- CategorySystem
- LicenceBSD-3-Clause
- Maintainercore-libraries-committee@haskell.org
- Pinned byhackage random 1.3.1
- Sourcehackage.haskell.org/package/random-1.3.1
Modules
3 modules- System.Random46This library deals with the common task of pseudo-random number generation.
- System.Random.Stateful105This library deals with the common task of pseudo-random number generation.
Internal modules · 1
- System.Random.Internal53This 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
6 packages- base-4.22.0.0with GHC
- bytestring-0.12.2.0with GHC
- deepseq-1.5.1.0with GHC
- mtl-2.3.1with GHC
- splitmix-0.1.3.2in this set
- transformers-0.6.1.2with GHC
Used by in this set · 30
- ImpSpec-0.2.0.0
- MonadRandom-0.6.2.1
- QuickCheck-2.18.0.0
- antigen-0.4.0.0
- cardano-api-11.7.0.0
- cardano-diffusion-1.1.1.0
- cardano-ledger-binary-1.9.1.0
- cardano-ledger-core-1.21.0.0
- cuddle-1.8.1.0
- foldl-1.4.18
- genvalidity-1.1.1.0
- hedgehog-1.7
- hspec-core-2.11.17
- http-client-0.7.19
- jsonrpc-tinyclient-1.1.0.0
- lsm-tree-1.1.1.0
- mwc-random-0.15.3.0
- ouroboros-consensus-4.2.1.0
- ouroboros-network-1.2.0.0
- quickcheck-transformer-0.3.1.3
- random-shuffle-0.0.4
- retry-0.9.3.1
- statistics-0.16.5.0
- statistics-linreg-0.3
- streaming-commons-0.2.3.1
- tasty-quickcheck-0.11.1
- temporary-1.3
- tls-2.2.2
- uuid-types-1.0.6.1
- websockets-0.13.0.0