GenT

case class GenT[A](run: (Size, Seed) => Tree[(Seed, Option[A])])

Generator for random values of A.

Companion:
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def ensure(p: A => Boolean): GenT[A]

Discards the generator if the generated value does not satisfy the predicate.

Discards the generator if the generated value does not satisfy the predicate.

def filter(p: A => Boolean): GenT[A]

Generates a value that satisfies a predicate.

Generates a value that satisfies a predicate.

We keep some state to avoid looping forever. If we trigger these limits then the whole generator is discarded.

def flatMap[B](f: A => GenT[B]): GenT[B]
def forAllWithLog(f: A => Log): PropertyT[A]
def lift: PropertyT[A]
def list(range: Range[Int]): GenT[List[A]]

Generates a list using a 'Range' to determine the length.

Generates a list using a 'Range' to determine the length.

def log(name: Name): PropertyT[A]

def map[B](f: A => B): GenT[B]
def mapTree[B](f: Tree[(Seed, Option[A])] => Tree[(Seed, Option[B])]): GenT[B]
def option: GenT[Option[A]]

Generates a 'None' some of the time.

Generates a 'None' some of the time.

def prune: GenT[A]

Throw away a generator's shrink tree.

Throw away a generator's shrink tree.

def resize(size: Size): GenT[A]

Override the size parameter. Returns a generator which uses the given size instead of the runtime-size parameter.

Override the size parameter. Returns a generator which uses the given size instead of the runtime-size parameter.

def scale(f: Size => Size): GenT[A]

Adjust the size parameter by transforming it with the given function.

Adjust the size parameter by transforming it with the given function.

def shrink(f: A => List[A]): GenT[A]

Apply a shrinking function to a generator.

Apply a shrinking function to a generator.

def small: GenT[A]

Make a generator smaller by scaling its size parameter.

Make a generator smaller by scaling its size parameter.

def withFilter(p: A => Boolean): GenT[A]

Generates a value that satisfies a predicate.

Generates a value that satisfies a predicate.

Equivalent to filter and is used in for-comprehensions.

Inherited methods

def productElementNames: Iterator[String]
Inherited from:
Product
def productIterator: Iterator[Any]
Inherited from:
Product