Random

zio.Random
See theRandom companion trait
object Random extends Serializable

Attributes

Companion
trait
Source
Random.scala
Graph
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Self type
Random.type

Members list

Type members

Classlikes

object RandomLive extends Random

Attributes

Source
Random.scala
Supertypes
trait Random
trait Serializable
class Object
trait Matchable
class Any
Self type
RandomLive.type
final case class RandomScala(random: Random) extends Random

An implementation of the Random service backed by a scala.util.Random.

An implementation of the Random service backed by a scala.util.Random.

Attributes

Source
Random.scala
Supertypes
trait Product
trait Equals
trait Random
trait Serializable
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def nextBoolean(implicit trace: Trace): UIO[Boolean]

generates a pseudo-random boolean.

generates a pseudo-random boolean.

Attributes

Source
Random.scala
def nextBytes(length: => Int)(implicit trace: Trace): UIO[Chunk[Byte]]

Generates a pseudo-random chunk of bytes of the specified length.

Generates a pseudo-random chunk of bytes of the specified length.

Attributes

Source
Random.scala
def nextDouble(implicit trace: Trace): UIO[Double]

Generates a pseudo-random, uniformly distributed double between 0.0 and 1.0.

Generates a pseudo-random, uniformly distributed double between 0.0 and 1.0.

Attributes

Source
Random.scala
def nextDoubleBetween(minInclusive: => Double, maxExclusive: => Double)(implicit trace: Trace): UIO[Double]

Generates a pseudo-random double in the specified range.

Generates a pseudo-random double in the specified range.

Attributes

Source
Random.scala
def nextFloat(implicit trace: Trace): UIO[Float]

Generates a pseudo-random, uniformly distributed float between 0.0 and 1.0.

Generates a pseudo-random, uniformly distributed float between 0.0 and 1.0.

Attributes

Source
Random.scala
def nextFloatBetween(minInclusive: => Float, maxExclusive: => Float)(implicit trace: Trace): UIO[Float]

Generates a pseudo-random float in the specified range.

Generates a pseudo-random float in the specified range.

Attributes

Source
Random.scala
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.

Generates a pseudo-random double from a normal distribution with mean 0.0 and standard deviation 1.0.

Attributes

Source
Random.scala
def nextInt(implicit trace: Trace): UIO[Int]

Generates a pseudo-random integer.

Generates a pseudo-random integer.

Attributes

Source
Random.scala
def nextIntBetween(minInclusive: => Int, maxExclusive: => Int)(implicit trace: Trace): UIO[Int]

Generates a pseudo-random integer in the specified range.

Generates a pseudo-random integer in the specified range.

Attributes

Source
Random.scala
def nextIntBounded(n: => Int)(implicit trace: Trace): UIO[Int]

Generates a pseudo-random integer between 0 (inclusive) and the specified value (exclusive).

Generates a pseudo-random integer between 0 (inclusive) and the specified value (exclusive).

Attributes

Source
Random.scala
def nextLong(implicit trace: Trace): UIO[Long]

Generates a pseudo-random long.

Generates a pseudo-random long.

Attributes

Source
Random.scala
def nextLongBetween(minInclusive: => Long, maxExclusive: => Long)(implicit trace: Trace): UIO[Long]

Generates a pseudo-random long in the specified range.

Generates a pseudo-random long in the specified range.

Attributes

Source
Random.scala
def nextLongBounded(n: => Long)(implicit trace: Trace): UIO[Long]

Generates a pseudo-random long between 0 (inclusive) and the specified value (exclusive).

Generates a pseudo-random long between 0 (inclusive) and the specified value (exclusive).

Attributes

Source
Random.scala
def nextPrintableChar(implicit trace: Trace): UIO[Char]

Generates a pseudo-random character from the ASCII range 33-126.

Generates a pseudo-random character from the ASCII range 33-126.

Attributes

Source
Random.scala
def nextString(length: => Int)(implicit trace: Trace): UIO[String]

Generates a pseudo-random string of the specified length.

Generates a pseudo-random string of the specified length.

Attributes

Source
Random.scala
def nextUUID(implicit trace: Trace): UIO[UUID]

Generates psuedo-random universally unique identifiers.

Generates psuedo-random universally unique identifiers.

Attributes

Source
Random.scala
def setSeed(seed: => Long)(implicit trace: Trace): UIO[Unit]

Sets the seed of this random number generator.

Sets the seed of this random number generator.

Attributes

Source
Random.scala
def shuffle[A](list: => List[A])(implicit trace: Trace): UIO[List[A]]

Randomly shuffles the specified list.

Randomly shuffles the specified list.

Attributes

Source
Random.scala

Implicits

Implicits

implicit val tag: Tag[Random]

Attributes

Source
Random.scala