Trait

hedgehog

GenTOps

Related Doc: package hedgehog

Permalink

trait GenTOps extends MonadGenOps[Gen]

Linear Supertypes
MonadGenOps[Gen], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GenTOps
  2. MonadGenOps
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def boolean: GenT[Boolean]

    Permalink

    Generates a random boolean.

    Generates a random boolean.

    _This generator shrinks to 'False'._

  6. def byte(range: Range[Byte]): GenT[Byte]

    Permalink
  7. def char(lo: Char, hi: Char): GenT[Char]

    Permalink
  8. def choice[A](x: GenT[A], xs: List[GenT[A]]): GenT[A]

    Permalink

    Randomly selects one of the generators in the list.

    Randomly selects one of the generators in the list.

    This generator shrinks towards the first generator in the list.

  9. def choice1[A](x: GenT[A], xs: GenT[A]*): GenT[A]

    Permalink

    Randomly selects one of the generators in the list.

    Randomly selects one of the generators in the list.

    This generator shrinks towards the first generator in the list.

  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def constant[A](x: ⇒ A): GenT[A]

    Permalink

    Trivial generator that always produces the same element.

  12. def discard[A](implicit G: MonadGen[Gen]): Gen[A]

    Permalink

    Discards the whole generator.

    Discards the whole generator.

    Definition Classes
    MonadGenOps
  13. def double(range: Range[Double]): GenT[Double]

    Permalink

    *******************************************************************

  14. def double_(range: Range[Double]): GenT[Double]

    Permalink
  15. def element[A](x: A, xs: List[A]): GenT[A]

    Permalink

    Randomly selects one of the elements in the list.

    Randomly selects one of the elements in the list.

    This generator shrinks towards the first element in the list.

  16. def element1[A](x: A, xs: A*): GenT[A]

    Permalink

    Randomly selects one of the elements in the list.

    Randomly selects one of the elements in the list.

    This generator shrinks towards the first element in the list.

  17. def elementUnsafe[A](xs: List[A]): GenT[A]

    Permalink

    Randomly selects one of the elements in the list.

    Randomly selects one of the elements in the list.

    This generator shrinks towards the first element in the list.

    WARNING: This may throw an exception if the list is empty, please use one of the other element variants if possible

  18. def ensure[A](gen: Gen[A], p: (A) ⇒ Boolean)(implicit F: Monad[Gen], G: MonadGen[Gen]): Gen[A]

    Permalink

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

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

    Definition Classes
    MonadGenOps
  19. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  21. def filter[A](gen: Gen[A])(p: (A) ⇒ Boolean)(implicit F: Monad[Gen], G: MonadGen[Gen]): Gen[A]

    Permalink

    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.

    Definition Classes
    MonadGenOps
  22. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  23. def frequency[A](a: (Int, GenT[A]), l: List[(Int, GenT[A])]): GenT[A]

    Permalink

    Uses a weighted distribution to randomly select one of the generators in the list.

    Uses a weighted distribution to randomly select one of the generators in the list.

    This generator shrinks towards the first generator in the list.

  24. def frequency1[A](a: (Int, GenT[A]), l: (Int, GenT[A])*): GenT[A]

    Permalink

    Uses a weighted distribution to randomly select one of the generators in the list.

    Uses a weighted distribution to randomly select one of the generators in the list.

    This generator shrinks towards the first generator in the list.

  25. def frequencyUnsafe[A](xs: List[(Int, GenT[A])]): GenT[A]

    Permalink

    Uses a weighted distribution to randomly select one of the generators in the list.

    Uses a weighted distribution to randomly select one of the generators in the list.

    This generator shrinks towards the first generator in the list.

    WARNING: This may throw an exception if the list is empty, please use one of the other frequency variants if possible.

  26. def fromSome[A](gen: Gen[Option[A]])(implicit F: Monad[Gen], G: MonadGen[Gen]): Gen[A]

    Permalink

    Runs a Option generator until it produces a Some.

    Runs a Option generator until it produces a Some.

    This is implemented using filter and has the same caveats.

    Definition Classes
    MonadGenOps
  27. def generate[A](f: (Size, Seed) ⇒ (Seed, A))(implicit G: MonadGen[Gen]): Gen[A]

    Permalink

    Construct a generator that depends on the size parameter.

    Construct a generator that depends on the size parameter.

    Definition Classes
    MonadGenOps
  28. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  29. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  30. def int(range: Range[Int]): GenT[Int]

    Permalink

    *******************************************************************

  31. def integral[A](range: Range[A], fromLong: (Long) ⇒ A)(implicit arg0: Integral[A], F: MonadGen[Gen]): Gen[A]

    Permalink

    Generates a random integral number in the given [inclusive,inclusive] range.

    Generates a random integral number in the given [inclusive,inclusive] range.

    When the generator tries to shrink, it will shrink towards the Range.origin of the specified Range.

    For example, the following generator will produce a number between 1970 and 2100, but will shrink towards 2000:

    Gen.integral(Range.constantFrom(2000, 1970, 2100))

    Some sample outputs from this generator might look like:

    === Outcome ===
    1973
    === Shrinks ===
    2000
    1987
    1980
    1976
    1974
    
    === Outcome ===
    2061
    === Shrinks ===
    2000
    2031
    2046
    2054
    2058
    2060
    Definition Classes
    MonadGenOps
  32. def integral_[A](range: Range[A], fromLong: (Long) ⇒ A)(implicit G: MonadGen[Gen], I: Integral[A]): Gen[A]

    Permalink

    Generates a random integral number in the [inclusive,inclusive] range.

    Generates a random integral number in the [inclusive,inclusive] range.

    This generator does not shrink.

    Definition Classes
    MonadGenOps
  33. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  34. def list[A](gen: Gen[A], range: Range[Int])(implicit F: Monad[Gen], G: MonadGen[Gen]): Gen[List[A]]

    Permalink

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

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

    Definition Classes
    MonadGenOps
  35. def long(range: Range[Long]): GenT[Long]

    Permalink
  36. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  37. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  38. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  39. def short(range: Range[Short]): GenT[Short]

    Permalink
  40. def sized[A](f: (Size) ⇒ Gen[A])(implicit F: Monad[Gen], G: MonadGen[Gen]): Gen[A]

    Permalink

    Construct a generator that depends on the size parameter.

    Construct a generator that depends on the size parameter.

    Definition Classes
    MonadGenOps
  41. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  42. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  43. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from MonadGenOps[Gen]

Inherited from AnyRef

Inherited from Any

Ungrouped