Class/Object

nyaya.gen

Gen

Related Docs: object Gen | package gen

Permalink

final case class Gen[+A](run: Run[A]) extends AnyVal with Product with Serializable

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Gen
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyVal
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Gen(run: Run[A])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    Any
  3. def ***[B](g: Gen[B]): Gen[(A, B)]

    Permalink
  4. def +++[B](g: Gen[B]): Gen[\/[A, B]]

    Permalink
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  6. def >>[B](f: Gen[B]): Gen[B]

    Permalink
  7. def \&/[B](g: Gen[B]): Gen[\&/[A, B]]

    Permalink
  8. def \/[B](g: Gen[B]): Gen[\/[A, B]]

    Permalink
  9. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  10. def either[B](g: Gen[B]): Gen[Either[A, B]]

    Permalink
  11. def fill[B](n: Int)(implicit cbf: CanBuildFrom[Nothing, A, B]): Gen[B]

    Permalink
  12. def fillFold[B](n: Int, z: B)(f: (B, A) ⇒ B): Gen[B]

    Permalink
  13. def fillFoldSS[B](ss: SizeSpec, z: B)(f: (B, A) ⇒ B): Gen[B]

    Permalink
    Annotations
    @inline()
  14. def fillFoldSS1[B](ss: SizeSpec, z: B)(f: (B, A) ⇒ B): Gen[B]

    Permalink
    Annotations
    @inline()
  15. def fillSS[B](ss: SizeSpec)(implicit cbf: CanBuildFrom[Nothing, A, B]): Gen[B]

    Permalink
    Annotations
    @inline()
  16. def fillSS1[B](ss: SizeSpec)(implicit cbf: CanBuildFrom[Nothing, A, B]): Gen[B]

    Permalink
    Annotations
    @inline()
  17. def flatMap[B](f: (A) ⇒ Gen[B]): Gen[B]

    Permalink
  18. def flatten[B](implicit ev: <:<[A, Gen[B]]): Gen[B]

    Permalink
  19. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  20. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  21. def list(implicit ss: SizeSpec): Gen[List[A]]

    Permalink
  22. def list1(implicit ss: SizeSpec): Gen[List[A]]

    Permalink
  23. def map[B](f: (A) ⇒ B): Gen[B]

    Permalink
  24. def mapBy[K](gk: Gen[K])(implicit ss: SizeSpec): Gen[Map[K, A]]

    Permalink
  25. def mapByEachKey[K](keys: TraversableOnce[K]): Gen[Map[K, A]]

    Permalink
  26. def mapByKeySubset[K](legalKeys: TraversableOnce[K]): Gen[Map[K, A]]

    Permalink
  27. def mapTo[K >: A, V](gv: Gen[V])(implicit ss: SizeSpec): Gen[Map[K, V]]

    Permalink
    Annotations
    @inline()
  28. def nyayaNEL(implicit ss: SizeSpec): Gen[NonEmptyList[A]]

    Permalink
  29. def option: Gen[Option[A]]

    Permalink
  30. def optionGet[B](implicit ev: <:<[A, Option[B]]): Gen[B]

    Permalink

    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.

  31. def optionGetLimit[B](maxAttempts: Int)(implicit ev: <:<[A, Option[B]]): Gen[B]

    Permalink
  32. def pair: Gen[(A, A)]

    Permalink
  33. val run: Run[A]

    Permalink
  34. def sample(): A

    Permalink

    Produce a sample datum.

  35. def samples(ctx: GenCtx): Iterator[A]

    Permalink

    Produce an infinite stream of generated data.

    Produce an infinite stream of generated data.

    Use .take(n) for a finite number of samples.

  36. def samples(): Iterator[A]

    Permalink

    Produce an infinite stream of generated data.

    Produce an infinite stream of generated data.

    Use .take(n) for a finite number of samples.

  37. def samplesSized(genSize: Int): Iterator[A]

    Permalink

    Produce an infinite stream of generated data.

    Produce an infinite stream of generated data.

    Use .take(n) for a finite number of samples.

  38. def scalazNEL[B >: A](implicit ss: SizeSpec): Gen[NonEmptyList[B]]

    Permalink
  39. def set[B >: A](implicit ss: SizeSpec): Gen[Set[B]]

    Permalink
  40. def set1[B >: A](implicit ss: SizeSpec): Gen[Set[B]]

    Permalink
  41. def shuffle[C[X] <: TraversableOnce[X], B](implicit ev: <:<[A, C[B]], cbf: CanBuildFrom[C[B], B, C[B]]): Gen[C[B]]

    Permalink
  42. def sizedSet[B >: A](implicit ss: SizeSpec): Gen[Set[B]]

    Permalink

    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.set(3) will never return.

  43. def sizedSet1[B >: A](implicit ss: SizeSpec): Gen[Set[B]]

    Permalink

    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.set1(3) will never return.

  44. def stream(implicit ss: SizeSpec): Gen[Stream[A]]

    Permalink
  45. def stream1(implicit ss: SizeSpec): Gen[Stream[A]]

    Permalink
  46. def strengthL[B](b: B): Gen[(B, A)]

    Permalink
  47. def strengthR[B](b: B): Gen[(A, B)]

    Permalink
  48. def subset[C[X] <: TraversableOnce[X], B](implicit ev: <:<[A, C[B]], cbf: CanBuildFrom[Nothing, B, C[B]]): Gen[C[B]]

    Permalink
  49. def subset1[C[X] <: IndexedSeq[X], B](implicit ev: <:<[A, C[B]], cbf: CanBuildFrom[Nothing, B, C[B]]): Gen[C[B]]

    Permalink

    Generates a non-empty subset, unless the underlying seq is empty (in which case this returns an empty seq too).

  50. def take[C[X] <: TraversableOnce[X], B](n: SizeSpec)(implicit ev: <:<[A, C[B]], cbf: CanBuildFrom[Nothing, B, C[B]]): Gen[C[B]]

    Permalink
  51. def triple: Gen[(A, A, A)]

    Permalink
  52. def vector(implicit ss: SizeSpec): Gen[Vector[A]]

    Permalink
  53. def vector1(implicit ss: SizeSpec): Gen[Vector[A]]

    Permalink
  54. def withFilter(p: (A) ⇒ Boolean): Gen[A]

    Permalink
  55. def withOptionalSeed(s: Option[Long]): Gen[A]

    Permalink
  56. def withRandomSeed: Gen[A]

    Permalink
  57. def withSeed(seed: Long): Gen[A]

    Permalink

Deprecated Value Members

  1. def nel[B >: A](implicit ss: SizeSpec): Gen[NonEmptyList[B]]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.7.0) Replace with scalazNEL.

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyVal

Inherited from Any

Ungrouped