Packages

final case class Gen[-R, +A](sample: ZStream[R, Nothing, Option[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]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Gen
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Gen(sample: ZStream[R, Nothing, Option[Sample[R, A]]])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def <*>[R1 <: R, B](that: Gen[R1, B])(implicit zippable: Zippable[A, B], trace: ZTraceElement): Gen[R1, Out]

    A symbolic alias for zip.

  4. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. def collect[B](pf: PartialFunction[A, B])(implicit trace: ZTraceElement): Gen[R, B]

    Maps the values produced by this generator with the specified partial function, discarding any values the partial function is not defined at.

  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def filter(f: (A) => Boolean)(implicit trace: ZTraceElement): 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 filter can reduce test performance, especially if many values must be discarded. It is recommended to use combinators such as map and flatMap to create generators of the desired values instead.

    val evens: Gen[Has[Random], Int] = Gen.int.map(_ * 2)
  10. def filterNot(f: (A) => Boolean)(implicit trace: ZTraceElement): Gen[R, A]

    Filters the values produced by this generator, discarding any values that meet the specified predicate.

  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  12. def flatMap[R1 <: R, B](f: (A) => Gen[R1, B])(implicit trace: ZTraceElement): Gen[R1, B]
  13. def flatten[R1 <: R, B](implicit ev: <:<[A, Gen[R1, B]], trace: ZTraceElement): Gen[R1, B]
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. def map[B](f: (A) => B)(implicit trace: ZTraceElement): Gen[R, B]
  17. def mapZIO[R1 <: R, B](f: (A) => ZIO[R1, Nothing, B])(implicit trace: ZTraceElement): Gen[R1, B]

    Maps an effectual function over a generator.

  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def noShrink(implicit trace: ZTraceElement): Gen[R, A]

    Discards the shrinker for this generator.

  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. def productElementNames: Iterator[String]
    Definition Classes
    Product
  23. def reshrink[R1 <: R, B](f: (A) => Sample[R1, B])(implicit trace: ZTraceElement): 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.

  24. def resize(size: Int)(implicit trace: ZTraceElement): Gen[R with Has[Sized], A]

    Sets the size parameter for this generator to the specified value.

  25. def runCollect(implicit trace: ZTraceElement): ZIO[R, Nothing, List[A]]

    Runs the generator and collects all of its values in a list.

  26. def runCollectN(n: Int)(implicit trace: ZTraceElement): ZIO[R, Nothing, List[A]]

    Repeatedly runs the generator and collects the specified number of values in a list.

  27. def runHead(implicit trace: ZTraceElement): ZIO[R, Nothing, Option[A]]

    Runs the generator returning the first value of the generator.

  28. val sample: ZStream[R, Nothing, Option[Sample[R, A]]]
  29. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  30. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  33. def withFilter(f: (A) => Boolean)(implicit trace: ZTraceElement): Gen[R, A]
  34. def zip[R1 <: R, B](that: Gen[R1, B])(implicit zippable: Zippable[A, B], trace: ZTraceElement): Gen[R1, Out]

    Composes this generator with the specified generator to create a cartesian product of elements.

  35. def zipWith[R1 <: R, B, C](that: Gen[R1, B])(f: (A, B) => C)(implicit trace: ZTraceElement): Gen[R1, C]

    Composes this generator with the specified generator to create a cartesian product of elements with the specified function.

Deprecated Value Members

  1. def <&>[R1 <: R, B](that: Gen[R1, B])(implicit zippable: Zippable[A, B], trace: ZTraceElement): Gen[R1, Out]

    A symbolic alias for zip.

    A symbolic alias for zip.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use <*>

  2. def cross[R1 <: R, B](that: Gen[R1, B])(implicit zippable: Zippable[A, B], trace: ZTraceElement): Gen[R1, Out]

    Composes this generator with the specified generator to create a cartesian product of elements.

    Composes this generator with the specified generator to create a cartesian product of elements.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use zip

  3. def crossWith[R1 <: R, B, C](that: Gen[R1, B])(f: (A, B) => C)(implicit trace: ZTraceElement): Gen[R1, C]

    Composes this generator with the specified generator to create a cartesian product of elements with the specified function.

    Composes this generator with the specified generator to create a cartesian product of elements with the specified function.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use zipWith

  4. def mapM[R1 <: R, B](f: (A) => ZIO[R1, Nothing, B])(implicit trace: ZTraceElement): Gen[R1, B]

    Maps an effectual function over a generator.

    Maps an effectual function over a generator.

    Annotations
    @deprecated
    Deprecated

    (Since version 2.0.0) use mapZIO

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped