Object/Class

org.scalacheck

Arbitrary

Related Docs: class Arbitrary | package scalacheck

Permalink

object Arbitrary

Defines implicit org.scalacheck.Arbitrary instances for common types.

ScalaCheck uses implicit org.scalacheck.Arbitrary instances when creating properties out of functions with the Prop.property method, and when the Arbitrary.arbitrary method is used. For example, the following code requires that there exists an implicit Arbitrary[MyClass] instance:

val myProp = Prop.forAll { myClass: MyClass =>
  ...
}

val myGen = Arbitrary.arbitrary[MyClass]

The required implicit definition could look like this:

implicit val arbMyClass: Arbitrary[MyClass] = Arbitrary(...)

The factory method Arbitrary(...) takes a generator of type Gen[T] and returns an instance of Arbitrary[T].

The Arbitrary module defines implicit org.scalacheck.Arbitrary instances for common types, for convenient use in your properties and generators.

Source
Arbitrary.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Arbitrary
  2. AnyRef
  3. 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 apply[T](g: ⇒ Gen[T]): Arbitrary[T]

    Permalink

    Creates an Arbitrary instance

  5. implicit lazy val arbAnyVal: Arbitrary[AnyVal]

    Permalink

    Arbitrary AnyVal

  6. implicit lazy val arbBigDecimal: Arbitrary[BigDecimal]

    Permalink

    Arbitrary BigDecimal

  7. implicit lazy val arbBigInt: Arbitrary[BigInt]

    Permalink

    Arbitrary BigInt

  8. implicit lazy val arbBitSet: Arbitrary[BitSet]

    Permalink

    Arbitrary instance of scala.collection.BitSet

  9. implicit lazy val arbBool: Arbitrary[Boolean]

    Permalink

    Arbitrary instance of Boolean

  10. implicit lazy val arbByte: Arbitrary[Byte]

    Permalink

    Arbitrary instance of Byte

  11. implicit lazy val arbChar: Arbitrary[Char]

    Permalink

    Arbitrary instance of Char

  12. implicit def arbContainer[C[_], T](implicit a: Arbitrary[T], b: Buildable[T, C[T]], t: (C[T]) ⇒ Traversable[T]): Arbitrary[C[T]]

    Permalink

    Arbitrary instance of any org.scalacheck.util.Buildable container (such as lists, arrays, streams, etc).

    Arbitrary instance of any org.scalacheck.util.Buildable container (such as lists, arrays, streams, etc). The maximum size of the container depends on the size generation parameter.

  13. implicit def arbContainer2[C[_, _], T, U](implicit a: Arbitrary[(T, U)], b: Buildable[(T, U), C[T, U]], t: (C[T, U]) ⇒ Traversable[(T, U)]): Arbitrary[C[T, U]]

    Permalink

    Arbitrary instance of any org.scalacheck.util.Buildable container (such as maps).

    Arbitrary instance of any org.scalacheck.util.Buildable container (such as maps). The maximum size of the container depends on the size generation parameter.

  14. implicit lazy val arbDate: Arbitrary[Date]

    Permalink

    Arbitrary instance of Date

  15. implicit lazy val arbDouble: Arbitrary[Double]

    Permalink

    Arbitrary instance of Double

  16. implicit def arbEither[T, U](implicit at: Arbitrary[T], au: Arbitrary[U]): Arbitrary[Either[T, U]]

    Permalink

    Arbitrary instance of the Either type

  17. implicit lazy val arbError: Arbitrary[Error]

    Permalink

    Arbitrary instance of Error

  18. implicit lazy val arbException: Arbitrary[Exception]

    Permalink

    Arbitrary instance of Exception

  19. implicit lazy val arbFloat: Arbitrary[Float]

    Permalink

    Arbitrary instance of Float

  20. implicit def arbFunction1[T1, R](implicit a: Arbitrary[R]): Arbitrary[(T1) ⇒ R]

    Permalink

    Arbitrary instance of Function1

  21. implicit def arbFunction2[T1, T2, R](implicit a: Arbitrary[R]): Arbitrary[(T1, T2) ⇒ R]

    Permalink

    Arbitrary instance of Function2

  22. implicit def arbFunction3[T1, T2, T3, R](implicit a: Arbitrary[R]): Arbitrary[(T1, T2, T3) ⇒ R]

    Permalink

    Arbitrary instance of Function3

  23. implicit def arbFunction4[T1, T2, T3, T4, R](implicit a: Arbitrary[R]): Arbitrary[(T1, T2, T3, T4) ⇒ R]

    Permalink

    Arbitrary instance of Function4

  24. implicit def arbFunction5[T1, T2, T3, T4, T5, R](implicit a: Arbitrary[R]): Arbitrary[(T1, T2, T3, T4, T5) ⇒ R]

    Permalink

    Arbitrary instance of Function5

  25. implicit def arbGen[T](implicit a: Arbitrary[T]): Arbitrary[Gen[T]]

    Permalink

    Arbitrary instance of org.scalacheck.Gen

  26. implicit lazy val arbGenParams: Arbitrary[Parameters]

    Permalink

    Arbitrary instance of gen params

  27. implicit lazy val arbInt: Arbitrary[Int]

    Permalink

    Arbitrary instance of Int

  28. implicit lazy val arbLong: Arbitrary[Long]

    Permalink

    Arbitrary instance of Long

  29. implicit lazy val arbNumber: Arbitrary[Number]

    Permalink

    Arbitrary java.lang.Number

  30. implicit def arbOption[T](implicit a: Arbitrary[T]): Arbitrary[Option[T]]

    Permalink

    Arbitrary instance of the Option type

  31. implicit lazy val arbProp: Arbitrary[Prop]

    Permalink

    Generates an arbitrary property

  32. implicit lazy val arbShort: Arbitrary[Short]

    Permalink

    Arbitrary instance of Short

  33. implicit lazy val arbString: Arbitrary[String]

    Permalink

    Arbitrary instance of String

  34. implicit lazy val arbTestParameters: Arbitrary[Parameters]

    Permalink

    Arbitrary instance of test parameters

  35. implicit lazy val arbThrowable: Arbitrary[Throwable]

    Permalink

    Arbitrary instance of Throwable

  36. implicit def arbTuple2[T1, T2](implicit a1: Arbitrary[T1], a2: Arbitrary[T2]): Arbitrary[(T1, T2)]

    Permalink

    Arbitrary instance of 2-tuple

  37. implicit def arbTuple3[T1, T2, T3](implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3]): Arbitrary[(T1, T2, T3)]

    Permalink

    Arbitrary instance of 3-tuple

  38. implicit def arbTuple4[T1, T2, T3, T4](implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4]): Arbitrary[(T1, T2, T3, T4)]

    Permalink

    Arbitrary instance of 4-tuple

  39. implicit def arbTuple5[T1, T2, T3, T4, T5](implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5]): Arbitrary[(T1, T2, T3, T4, T5)]

    Permalink

    Arbitrary instance of 5-tuple

  40. implicit def arbTuple6[T1, T2, T3, T4, T5, T6](implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5], a6: Arbitrary[T6]): Arbitrary[(T1, T2, T3, T4, T5, T6)]

    Permalink

    Arbitrary instance of 6-tuple

  41. implicit def arbTuple7[T1, T2, T3, T4, T5, T6, T7](implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5], a6: Arbitrary[T6], a7: Arbitrary[T7]): Arbitrary[(T1, T2, T3, T4, T5, T6, T7)]

    Permalink

    Arbitrary instance of 7-tuple

  42. implicit def arbTuple8[T1, T2, T3, T4, T5, T6, T7, T8](implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5], a6: Arbitrary[T6], a7: Arbitrary[T7], a8: Arbitrary[T8]): Arbitrary[(T1, T2, T3, T4, T5, T6, T7, T8)]

    Permalink

    Arbitrary instance of 8-tuple

  43. implicit def arbTuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9](implicit a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4], a5: Arbitrary[T5], a6: Arbitrary[T6], a7: Arbitrary[T7], a8: Arbitrary[T8], a9: Arbitrary[T9]): Arbitrary[(T1, T2, T3, T4, T5, T6, T7, T8, T9)]

    Permalink

    Arbitrary instance of 9-tuple

  44. implicit lazy val arbUnit: Arbitrary[Unit]

    Permalink

    Absolutely, totally, 100% arbitrarily chosen Unit.

  45. def arbitrary[T](implicit a: Arbitrary[T]): Gen[T]

    Permalink

    Returns an arbitrary generator for the type T.

  46. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  47. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  50. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  51. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  53. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  54. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  57. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped