Sample

final case class Sample[-R, +A](value: A, shrink: ZStream[R, Nothing, Sample[R, A]])

A sample is a single observation from a random variable, together with a tree of "shrinkings" used for minimization of "large" failures.

Companion:
object
trait Product
trait Equals
class Object
trait Matchable
class Any
Sample[R, A]

Value members

Concrete methods

def <&>[R1 <: R, B](that: Sample[R1, B]): Sample[R1, (A, B)]

A symbolic alias for zip.

A symbolic alias for zip.

def <*>[R1 <: R, B](that: Sample[R1, B]): Sample[R1, (A, B)]

A symbolic alias for cross.

A symbolic alias for cross.

def cross[R1 <: R, B](that: Sample[R1, B]): Sample[R1, (A, B)]

Composes this sample with the specified sample to create a cartesian product of values and shrinkings.

Composes this sample with the specified sample to create a cartesian product of values and shrinkings.

def crossWith[R1 <: R, B, C](that: Sample[R1, B])(f: (A, B) => C): Sample[R1, C]

Composes this sample with the specified sample to create a cartesian product of values and shrinkings with the specified function.

Composes this sample with the specified sample to create a cartesian product of values and shrinkings with the specified function.

def filter(f: A => Boolean): ZStream[R, Nothing, Sample[R, A]]

Filters this sample by replacing it with its shrink tree if the value does not meet the specified predicate and recursively filtering the shrink tree.

Filters this sample by replacing it with its shrink tree if the value does not meet the specified predicate and recursively filtering the shrink tree.

def flatMap[R1 <: R, B](f: A => Sample[R1, B]): Sample[R1, B]
def foreach[R1 <: R, B](f: A => ZIO[R1, Nothing, B]): ZIO[R1, Nothing, Sample[R1, B]]
def map[B](f: A => B): Sample[R, B]
def shrinkSearch(f: A => Boolean): ZStream[R, Nothing, A]

Converts the shrink tree into a stream of shrinkings by recursively searching the shrink tree, using the specified function to determine whether a value is a failure. The resulting stream will contain all values explored, regardless of whether they are successes or failures.

Converts the shrink tree into a stream of shrinkings by recursively searching the shrink tree, using the specified function to determine whether a value is a failure. The resulting stream will contain all values explored, regardless of whether they are successes or failures.

def zip[R1 <: R, B](that: Sample[R1, B]): Sample[R1, (A, B)]

Zips two samples together pairwise.

Zips two samples together pairwise.

def zipWith[R1 <: R, B, C](that: Sample[R1, B])(f: (A, B) => C): Sample[R1, C]

Zips two samples together pairwise with the specified function.

Zips two samples together pairwise with the specified function.

Inherited methods

Inherited from:
Product