-
Effekt Library
- random
- random
- random
- minstd
- minstd
- devurandom
- randomByte
- randomBytes
- randomBool
- randomBools
- randomInt32
- randomInt32s
- randomInt
- randomInts
- randomDouble
- randomDoubles
- main
- prngRandom
- unixRandom
- random Jump to source: libraries/common/random.effekt
- random
- random
: Byte / {}
- minstd
(seed: Int): Unit / {emit[Byte]}
- minstd
(seed: Int) { randomnessReader: => Unit / {random} }: Unit / {}
- devurandom
{ randomnessReader: => Unit / {random} }: Unit / {Exception[IOError]}
- randomByte
: Byte / {random}
- randomBytes
: Unit / {emit[Byte], random}
- randomBool
: Bool / {random}
- randomBools
: Unit / {emit[Bool], random}
- randomInt32
: Int / {random}
- randomInt32s
: Unit / {emit[Int], random}
- randomInt
(min: Int, max: Int): Int / {random}
- randomInts
(min: Int, max: Int): Unit / {emit[Int], random}
- randomDouble
: Double / {random}
- randomDoubles
: Unit / {emit[Double], random}
- main
- prngRandom
: Unit / {}
- unixRandom
: Unit / {}
Example usage: examples/stdlib/random
Infinite pull stream of random bytes.
Infinite pull stream of random bytes.
A streaming source (push stream) of byte-level randomness based on Park and Miller's MINSTD with revised parameters. Deterministic: needs a 32bit `seed` -- you can use `bench::timestamp`.
A thin wrapper over `minstd`, handling a reader of random bytes. Deterministic: needs a 32bit `seed` -- you can use `bench::timestamp`. Implementation is similar to `stream::source`, specialized for bytes and the `random` effect.
CSPRNG from `/dev/urandom`, handling a reader of random bytes. Only works on Unix-like OSes!
`max` is _inclusive_!
`max` is _inclusive_!
Random double between 0.0 and 1.0