object Random extends Serializable
- Alphabetic
- By Inheritance
- Random
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final case class RandomScala(random: scala.util.Random) extends Random with Product with Serializable
An implementation of the
Random
service backed by ascala.util.Random
.
Value Members
- def nextBoolean(implicit trace: Trace): UIO[Boolean]
generates a pseudo-random boolean.
- def nextBytes(length: => Int)(implicit trace: Trace): UIO[Chunk[Byte]]
Generates a pseudo-random chunk of bytes of the specified length.
- def nextDouble(implicit trace: Trace): UIO[Double]
Generates a pseudo-random, uniformly distributed double between 0.0 and 1.0.
- def nextDoubleBetween(minInclusive: => Double, maxExclusive: => Double)(implicit trace: Trace): UIO[Double]
Generates a pseudo-random double in the specified range.
- def nextFloat(implicit trace: Trace): UIO[Float]
Generates a pseudo-random, uniformly distributed float between 0.0 and 1.0.
- def nextFloatBetween(minInclusive: => Float, maxExclusive: => Float)(implicit trace: Trace): UIO[Float]
Generates a pseudo-random float in the specified range.
- def nextGaussian(implicit trace: Trace): UIO[Double]
Generates a pseudo-random double from a normal distribution with mean 0.0 and standard deviation 1.0.
- def nextInt(implicit trace: Trace): UIO[Int]
Generates a pseudo-random integer.
- def nextIntBetween(minInclusive: => Int, maxExclusive: => Int)(implicit trace: Trace): UIO[Int]
Generates a pseudo-random integer in the specified range.
- def nextIntBounded(n: => Int)(implicit trace: Trace): UIO[Int]
Generates a pseudo-random integer between 0 (inclusive) and the specified value (exclusive).
- def nextLong(implicit trace: Trace): UIO[Long]
Generates a pseudo-random long.
- def nextLongBetween(minInclusive: => Long, maxExclusive: => Long)(implicit trace: Trace): UIO[Long]
Generates a pseudo-random long in the specified range.
- def nextLongBounded(n: => Long)(implicit trace: Trace): UIO[Long]
Generates a pseudo-random long between 0 (inclusive) and the specified value (exclusive).
- def nextPrintableChar(implicit trace: Trace): UIO[Char]
Generates a pseudo-random character from the ASCII range 33-126.
- def nextString(length: => Int)(implicit trace: Trace): UIO[String]
Generates a pseudo-random string of the specified length.
- def nextUUID(implicit trace: Trace): UIO[UUID]
Generates psuedo-random universally unique identifiers.
- def setSeed(seed: => Long)(implicit trace: Trace): UIO[Unit]
Sets the seed of this random number generator.
- def shuffle[A](list: => List[A])(implicit trace: Trace): UIO[List[A]]
Randomly shuffles the specified list.
- val tag: Tag[Random]
- object RandomLive extends Random