Pseudo-random number generation
183.48 KB
built 2026-10-14 01:27:50 GMT
Description
This package provides basic pseudo-random number generation, including the
ability to split random number generators.
== "System.Random": pure pseudo-random number interface
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':
>>> let roll = uniformR (1, 6) :: RandomGen g => g -> (Word, g) >>> let rolls =
unfoldr (Just . roll) :: RandomGen g => g -> [Word] >>> let pureGen = mkStdGen
42 >>> take 10 (rolls pureGen) :: [Word] [1,1,3,2,4,5,3,4,6,2]
See "System.Random" for more details.
== "System.Random.Stateful": monadic pseudo-random number interface
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':
>>> let rollM = uniformRM (1, 6) :: StatefulGen g m => g -> m Word >>> let
pureGen = mkStdGen 42 >>> runStateGen_ pureGen (replicateM 10 . rollM) ::
[Word] [1,1,3,2,4,5,3,4,6,2]
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
<https://hackage.haskell.org/package/mwc-random mwc-random> package:
>>> import System.Random.MWC as MWC >>> let rollM = uniformRM (1, 6) ::
StatefulGen g m => g -> m Word >>> monadicGen <- MWC.create >>> replicateM 10
(rollM monadicGen) :: IO [Word] [2,3,6,6,4,4,3,1,5,4]
See "System.Random.Stateful" for more details.
Dependencies
25 totalRequires22
- libHSarray-0.5.8.0-inplace-ghc9.10.3.so()(64bit)
- libHSbase-4.20.2.0-inplace-ghc9.10.3.so()(64bit)
- libHSbytestring-0.12.2.0-inplace-ghc9.10.3.so()(64bit)
- libHSdeepseq-1.5.0.0-inplace-ghc9.10.3.so()(64bit)
- libHSghc-bignum-1.3-inplace-ghc9.10.3.so()(64bit)
- libHSghc-boot-th-9.10.3-inplace-ghc9.10.3.so()(64bit)
- libHSghc-internal-9.1003.0-inplace-ghc9.10.3.so()(64bit)
- libHSghc-prim-0.12.0-inplace-ghc9.10.3.so()(64bit)
- libHSmtl-2.3.1-inplace-ghc9.10.3.so()(64bit)
- libHSpretty-1.1.3.6-inplace-ghc9.10.3.so()(64bit)
- libHSsplitmix-0.1.3.2-99T4YbtgOkJKPjdjelFKhJ-ghc9.10.3.so()(64bit)
- libHStemplate-haskell-2.22.0.0-inplace-ghc9.10.3.so()(64bit)
- libHStransformers-0.6.1.1-inplace-ghc9.10.3.so()(64bit)
- libc.so.6()(64bit)
- libc.so.6(GLIBC_2.27)(64bit)
- libgmp.so.10()(64bit)
- libm.so.6()(64bit)
- rpmlib(CompressedFileNames) <= 3.0.4-1
- rpmlib(FileDigests) <= 4.6.0-1
- rpmlib(PayloadFilesHavePrefix) <= 4.0-1
- rpmlib(PayloadIsZstd) <= 5.4.18-1
- rtld(GNU_HASH)
Provides3
- ghc-random = 1.2.1.3-8.fc45
- ghc-random(riscv-64) = 1.2.1.3-8.fc45
- libHSrandom-1.2.1.3-EAvZpIsCyhJF2FhxAE9Wl-ghc9.10.3.so()(64bit)
ObsoletesNo Obsoletes
ConflictsNo Conflicts
RecommendsNo Recommends
SuggestsNo Suggests
SupplementsNo Supplements
EnhancesNo Enhances
Files
3Name ![]() |
Size |
|---|---|
| /usr/lib64/ghc-9.10.3/lib/libHSrandom-1.2.1.3-EAvZpIsCyhJF2FhxAE9Wl-ghc9.10.3.so | 1.07 MB |
| /usr/share/licenses/ghc-random | 0.00 B |
| /usr/share/licenses/ghc-random/LICENSE | 2.87 KB |
Files 1–3 of 3
Component of
buildroots that installed this RPMBuildroot ![]() |
Created | State |
|---|---|---|
| f45-build-52931-913 | 2026-10-29 19:23:17 | expired |
| f45-build-52468-909 | 2026-10-29 18:10:14 | expired |
| f45-build-52454-909 | 2026-10-29 18:07:09 | expired |
| f45-build-52320-908 | 2026-10-29 17:53:57 | expired |
| f45-build-52303-908 | 2026-10-29 17:51:34 | expired |
| f45-build-52302-908 | 2026-10-29 17:50:35 | expired |
| f45-build-52301-908 | 2026-10-29 17:50:33 | expired |
| f45-build-52288-908 | 2026-10-29 17:48:45 | expired |
| f45-build-52259-908 | 2026-10-29 17:46:30 | expired |
| f45-build-52249-908 | 2026-10-29 17:44:30 | expired |
| f45-build-47468-867 | 2026-10-29 07:34:34 | expired |
| f45-build-46533-843 | 2026-10-22 15:05:20 | expired |
| f45-build-36870-708 | 2026-10-18 01:18:45 | expired |
| f45-build-35954-700 | 2026-10-17 22:59:52 | expired |
| f45-build-34721-690 | 2026-10-17 20:11:36 | expired |
| f45-build-21335-581 | 2026-10-16 15:11:46 | expired |
| f45-build-14458-459 | 2026-10-14 14:00:06 | expired |
| f45-build-14102-456 | 2026-10-14 13:03:30 | expired |
| f45-build-13939-455 | 2026-10-14 12:36:57 | expired |
| f45-build-13534-451 | 2026-10-14 11:43:17 | expired |
| f45-build-13213-426 | 2026-10-14 10:12:03 | expired |
| f45-build-11107-426 | 2026-10-14 04:08:52 | expired |
| f45-build-11047-426 | 2026-10-14 03:47:09 | expired |
| f45-build-11044-426 | 2026-10-14 03:46:18 | expired |
| f45-build-11037-426 | 2026-10-14 03:45:18 | expired |
| f45-build-11035-426 | 2026-10-14 03:45:13 | expired |
| f45-build-11028-426 | 2026-10-14 03:45:07 | expired |
| f45-build-10995-425 | 2026-10-14 03:39:08 | expired |
| f45-build-10994-425 | 2026-10-14 03:39:06 | expired |
| f45-build-10992-425 | 2026-10-14 03:39:05 | expired |
| f45-build-10988-425 | 2026-10-14 03:38:07 | expired |
| f45-build-10979-425 | 2026-10-14 03:35:51 | expired |
| f45-build-10978-425 | 2026-10-14 03:35:45 | expired |
| f45-build-10977-425 | 2026-10-14 03:35:00 | expired |
| f45-build-10976-425 | 2026-10-14 03:35:00 | expired |
| f45-build-10972-425 | 2026-10-14 03:34:55 | expired |
| f45-build-10971-425 | 2026-10-14 03:34:49 | expired |
| f45-build-10969-425 | 2026-10-14 03:34:48 | expired |
| f45-build-10964-425 | 2026-10-14 03:34:46 | expired |
| f45-build-10963-425 | 2026-10-14 03:34:46 | expired |
| f45-build-10962-425 | 2026-10-14 03:34:46 | expired |
| f45-build-10937-425 | 2026-10-14 03:29:42 | expired |
| f45-build-10935-425 | 2026-10-14 03:28:52 | expired |
| f45-build-10929-425 | 2026-10-14 03:28:49 | expired |
| f45-build-10923-425 | 2026-10-14 03:26:28 | expired |
| f45-build-10919-425 | 2026-10-14 03:25:39 | expired |
| f45-build-10916-425 | 2026-10-14 03:25:38 | expired |
| f45-build-10908-425 | 2026-10-14 03:25:32 | expired |
| f45-build-10874-424 | 2026-10-14 03:17:25 | expired |
| f45-build-10873-424 | 2026-10-14 03:17:20 | expired |
Buildroots 1–50 of 71
Next →

