Object

hedgehog

Gen

Related Doc: package hedgehog

Permalink

object Gen extends GenTOps with ByteOps with CharacterOps with StringOps with Serializable

This is _purely_ to make consuming this library a nicer experience, mainly due to Scala's type inference problems and higher kinds.

Linear Supertypes
Serializable, Serializable, StringOps, CharacterOps, ByteOps, GenTOps, MonadGenOps[Gen], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Gen
  2. Serializable
  3. Serializable
  4. StringOps
  5. CharacterOps
  6. ByteOps
  7. GenTOps
  8. MonadGenOps
  9. AnyRef
  10. 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. def alpha: GenT[Char]

    Permalink

    Generates an ASCII letter: 'a' to 'z', 'A' to 'Z'

    Generates an ASCII letter: 'a' to 'z', 'A' to 'Z'

    Definition Classes
    CharacterOps
  5. def alphaNum: GenT[Char]

    Permalink

    Generates an ASCII letter or digit: 'a' to 'z', 'A' to 'Z', '0' to '9'

    Generates an ASCII letter or digit: 'a' to 'z', 'A' to 'Z', '0' to '9'

    Definition Classes
    CharacterOps
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def ascii: GenT[Char]

    Permalink

    Generates an ASCII character

    Generates an ASCII character

    Definition Classes
    CharacterOps
  8. def binit: GenT[Char]

    Permalink

    Generates an ASCII binit: '0' to '1'

    Generates an ASCII binit: '0' to '1'

    Definition Classes
    CharacterOps
  9. def boolean: GenT[Boolean]

    Permalink

    Generates a random boolean.

    Generates a random boolean.

    _This generator shrinks to 'False'._

    Definition Classes
    GenTOps
  10. def byte(range: Range[Byte]): GenT[Byte]

    Permalink
    Definition Classes
    GenTOps
  11. def bytes(range: Range[Int]): GenT[Array[Byte]]

    Permalink

    Generates a random 'Array[Byte]', using 'Range' to determine the length.

    Generates a random 'Array[Byte]', using 'Range' to determine the length.

    _Shrinks down to the ascii characters._

    Definition Classes
    ByteOps
  12. def char(lo: Char, hi: Char): GenT[Char]

    Permalink
    Definition Classes
    GenTOps
  13. 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.

    Definition Classes
    GenTOps
  14. 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.

    Definition Classes
    GenTOps
  15. def clone(): AnyRef

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

    Permalink

    Trivial generator that always produces the same element.

    Trivial generator that always produces the same element.

    Definition Classes
    GenTOps
  17. def digit: GenT[Char]

    Permalink

    Generates an ASCII digit: '0' to '9'

    Generates an ASCII digit: '0' to '9'

    Definition Classes
    CharacterOps
  18. def discard[A](implicit G: MonadGen[Gen]): Gen[A]

    Permalink

    Discards the whole generator.

    Discards the whole generator.

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

    Permalink

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

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

    Definition Classes
    GenTOps
  20. def double_(range: Range[Double]): GenT[Double]

    Permalink
    Definition Classes
    GenTOps
  21. 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.

    Definition Classes
    GenTOps
  22. 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.

    Definition Classes
    GenTOps
  23. 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

    Definition Classes
    GenTOps
  24. 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
  25. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  27. 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
  28. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  29. 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.

    Definition Classes
    GenTOps
  30. 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.

    Definition Classes
    GenTOps
  31. 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.

    Definition Classes
    GenTOps
  32. 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
  33. 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
  34. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  36. def hexit: GenT[Char]

    Permalink

    Generates an ASCII hexit: '0' to '9', 'a' to 'f', 'A' to 'F'

    Generates an ASCII hexit: '0' to '9', 'a' to 'f', 'A' to 'F'

    Definition Classes
    CharacterOps
  37. def int(range: Range[Int]): GenT[Int]

    Permalink

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

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

    Definition Classes
    GenTOps
  38. 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
  39. 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
  40. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  41. def latin1: GenT[Char]

    Permalink

    Generates an Latin-1 character

    Generates an Latin-1 character

    Definition Classes
    CharacterOps
  42. 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
  43. def long(range: Range[Long]): GenT[Long]

    Permalink
    Definition Classes
    GenTOps
  44. def lower: GenT[Char]

    Permalink

    Generates an ASCII lowercase letter: 'a' to 'z'

    Generates an ASCII lowercase letter: 'a' to 'z'

    Definition Classes
    CharacterOps
  45. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  48. def octit: GenT[Char]

    Permalink

    Generates an ASCII octit: '0' to '7'

    Generates an ASCII octit: '0' to '7'

    Definition Classes
    CharacterOps
  49. def short(range: Range[Short]): GenT[Short]

    Permalink
    Definition Classes
    GenTOps
  50. 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
  51. def string(gen: GenT[Char], range: Range[Int]): GenT[String]

    Permalink

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

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

    Definition Classes
    StringOps
  52. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  54. def unicode: GenT[Char]

    Permalink

    Generates a Unicode character, excluding noncharacters and invalid standalone surrogates:

    Generates a Unicode character, excluding noncharacters and invalid standalone surrogates:

    Definition Classes
    CharacterOps
  55. def unicodeAll: GenT[Char]

    Permalink

    Generates a Unicode character, including noncharacters and invalid standalone surrogates

    Generates a Unicode character, including noncharacters and invalid standalone surrogates

    Definition Classes
    CharacterOps
  56. def upper: GenT[Char]

    Permalink

    Generates an ASCII uppercase letter: 'A' to 'Z'

    Generates an ASCII uppercase letter: 'A' to 'Z'

    Definition Classes
    CharacterOps
  57. final def wait(): Unit

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

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

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

Inherited from Serializable

Inherited from Serializable

Inherited from StringOps

Inherited from CharacterOps

Inherited from ByteOps

Inherited from GenTOps

Inherited from MonadGenOps[Gen]

Inherited from AnyRef

Inherited from Any

Ungrouped