case class Gen[-R, +A](sample: ZStream[R, Nothing, Sample[R, A]]) extends Product with Serializable
A Gen[R, A] represents a generator of values of type A, which requires
an environment R. Generators may be random or deterministic.
- Self Type
- Gen[R, A]
- Alphabetic
- By Inheritance
- Gen
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def <*>[R1 <: R, B](that: Gen[R1, B]): Gen[R1, (A, B)]
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def filter(f: (A) => Boolean): Gen[R, A]
Filters the values produced by this generator, discarding any values that do not meet the specified predicate.
Filters the values produced by this generator, discarding any values that do not meet the specified predicate. Using
filtercan reduce test performance, especially if many values must be discarded. It is recommended to use combinators such asmapandflatMapto create generators of the desired values instead.val evens: Gen[Random, Int] = Gen.anyInt.map(_ * 2)
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def flatMap[R1 <: R, B](f: (A) => Gen[R1, B]): Gen[R1, B]
- final def flatten[R1 <: R, B](implicit ev: <:<[A, Gen[R1, B]]): Gen[R1, B]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def map[B](f: (A) => B): Gen[R, B]
- final def mapM[R1 <: R, B](f: (A) => ZIO[R1, Nothing, B]): Gen[R1, B]
Maps an effectual function over a generator.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- final def reshrink[R1 <: R, B](f: (A) => Sample[R1, B]): Gen[R1, B]
Discards the shrinker for this generator and applies a new shrinker by mapping each value to a sample using the specified function.
Discards the shrinker for this generator and applies a new shrinker by mapping each value to a sample using the specified function. This is useful when the process to shrink a value is simpler than the process used to generate it.
- val sample: ZStream[R, Nothing, Sample[R, A]]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def zip[R1 <: R, B](that: Gen[R1, B]): Gen[R1, (A, B)]
- final def zipWith[R1 <: R, B, C](that: Gen[R1, B])(f: (A, B) => C): Gen[R1, C]