final case class Gen[+A](run: Run[A]) extends AnyVal with GenClassExt[A] with Product with Serializable
- Alphabetic
- By Inheritance
- Gen
- Serializable
- Serializable
- Product
- Equals
- GenClassExt
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
- def ***[B](g: Gen[B]): Gen[(A, B)]
-
def
+++[B](g: Gen[B]): Gen[\/[A, B]]
- Annotations
- @inline()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
- def >>[B](f: Gen[B]): Gen[B]
- def \&/[B](g: Gen[B]): Gen[\&/[A, B]]
- def \/[B](g: Gen[B]): Gen[\/[A, B]]
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def either[B](g: Gen[B]): Gen[Either[A, B]]
- def fill[B](n: Int)(implicit cbf: scala.collection.compat.Factory[A, B]): Gen[B]
- def fillFold[B](n: Int, z: B)(f: (B, A) ⇒ B): Gen[B]
-
def
fillFoldSS[B](ss: SizeSpec, z: B)(f: (B, A) ⇒ B): Gen[B]
- Annotations
- @inline()
-
def
fillFoldSS1[B](ss: SizeSpec, z: B)(f: (B, A) ⇒ B): Gen[B]
- Annotations
- @inline()
-
def
fillSS[B](ss: SizeSpec)(implicit cbf: scala.collection.compat.Factory[A, B]): Gen[B]
- Annotations
- @inline()
-
def
fillSS1[B](ss: SizeSpec)(implicit cbf: scala.collection.compat.Factory[A, B]): Gen[B]
- Annotations
- @inline()
- def flatMap[B](f: (A) ⇒ Gen[B]): Gen[B]
- def flatten[B](implicit ev: <:<[A, Gen[B]]): Gen[B]
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def list(implicit ss: SizeSpec): Gen[List[A]]
- def list1(implicit ss: SizeSpec): Gen[List[A]]
- def map[B](f: (A) ⇒ B): Gen[B]
- def mapBy[K](gk: Gen[K])(implicit ss: SizeSpec): Gen[Map[K, A]]
- def mapByEachKey[K](keys: Iterable[K]): Gen[Map[K, A]]
- def mapByKeySubset[K](legalKeys: Iterable[K]): Gen[Map[K, A]]
-
def
mapTo[K >: A, V](gv: Gen[V])(implicit ss: SizeSpec): Gen[Map[K, V]]
- Annotations
- @inline()
- def nyayaNEL(implicit ss: SizeSpec): Gen[NonEmptyList[A]]
- def option: Gen[Option[A]]
-
def
optionGet[B](implicit ev: <:<[A, Option[B]]): Gen[B]
Will keep generating options until one is defined, in which case it is returned.
Will keep generating options until one is defined, in which case it is returned.
If a non-empty option still isn't generated after 1000 attempts, an exception will be thrown.
It is recommended that you use this very sparingly. In nearly all cases, the better alternative is to write your generators such that a return value is guaranteed, rather than generating then discarding.
- def optionGetLimit[B](maxAttempts: Int)(implicit ev: <:<[A, Option[B]]): Gen[B]
- def pair: Gen[(A, A)]
- val run: Run[A]
-
def
sample(): A
Produce a sample datum.
-
def
samples(genSize: GenSize = GenSize.Default): Iterator[A]
Produce an infinite stream of generated data.
Produce an infinite stream of generated data.
Use
.take(n)
for a finite number of samples. -
def
samplesUsing(ctx: GenCtx): Iterator[A]
Produce an infinite stream of generated data.
Produce an infinite stream of generated data.
Use
.take(n)
for a finite number of samples. - def scalazNEL[B >: A](implicit ss: SizeSpec): Gen[NonEmptyList[B]]
- def set[B >: A](implicit ss: SizeSpec): Gen[Set[B]]
- def set1[B >: A](implicit ss: SizeSpec): Gen[Set[B]]
- def shuffle[C[X] <: Iterable[X], B](implicit ev: <:<[A, C[B]], cbf: BuildFrom[C[B], B, C[B]]): Gen[C[B]]
-
def
sizedSet[B >: A](implicit ss: SizeSpec): Gen[Set[B]]
This will ensure that only unique random data is used and that the resulting set has the desired size.
This will ensure that only unique random data is used and that the resulting set has the desired size.
This is dangerous in that it will block until it generates enough unique elements. For example,
Gen.bool.sizedSet(3)
will never return. -
def
sizedSet1[B >: A](implicit ss: SizeSpec): Gen[Set[B]]
This will ensure that only unique random data is used and that the resulting set has the desired size.
This will ensure that only unique random data is used and that the resulting set has the desired size.
This is dangerous in that it will block until it generates enough unique elements. For example,
Gen.bool.sizedSet1(3)
will never return. - def strengthL[B](b: B): Gen[(B, A)]
- def strengthR[B](b: B): Gen[(A, B)]
- def subset[C[X] <: Iterable[X], B](implicit ev: <:<[A, C[B]], cbf: scala.collection.compat.Factory[B, C[B]]): Gen[C[B]]
-
def
subset1[C[X] <: IndexedSeq[X], B](implicit ev: <:<[A, C[B]], cbf: scala.collection.compat.Factory[B, C[B]]): Gen[C[B]]
Generates a non-empty subset, unless the underlying seq is empty (in which case this returns an empty seq too).
- def take[C[X] <: Iterable[X], B](n: SizeSpec)(implicit ev: <:<[A, C[B]], cbf: scala.collection.compat.Factory[B, C[B]]): Gen[C[B]]
- def triple: Gen[(A, A, A)]
- def vector(implicit ss: SizeSpec): Gen[Vector[A]]
- def vector1(implicit ss: SizeSpec): Gen[Vector[A]]
- def withConstSeed(seed: Long): Gen[A]
- def withFilter(p: (A) ⇒ Boolean): Gen[A]
- def withOptionalConstSeed(s: Option[Long]): Gen[A]
- def withOptionalSeed(s: Option[Long]): Gen[A]
- def withSeed(seed: Long): Gen[A]