Choose

object Choose extends JavaTimeChoose

Provides implicit org.scalacheck.Gen.Choose instances

Provides implicit org.scalacheck.Gen.Choose instances

Companion
class
trait JavaTimeChoose
class Object
trait Matchable
class Any

Type members

Classlikes

class IllegalBoundsError[A](low: A, high: A) extends IllegalArgumentException
object chooseBigInt extends Choose[BigInt]
object chooseBigInteger extends Choose[BigInteger]

Value members

Concrete methods

def xmap[T, U](from: T => U, to: U => T)(c: Choose[T]): Choose[U]

Transform a Choose[T] to a Choose[U] where T and U are two isomorphic types whose relationship is described by the provided transformation functions. (exponential functor map)

Transform a Choose[T] to a Choose[U] where T and U are two isomorphic types whose relationship is described by the provided transformation functions. (exponential functor map)

Implicits

Implicits

implicit val chooseBigDecimal: Choose[BigDecimal]

Choose a BigDecimal number between two given numbers.

Choose a BigDecimal number between two given numbers.

The minimum scale used will be 34. That means that the fractional part will have at least 34 digits (more if one of the given numbers has a scale larger than 34).

The minimum scale was chosen based on Scala's default scale for expanding infinite fractions:

BigDecimal(1) / 3 // 0.3333333333333333333333333333333333

See chooseBigDecimalScale for more information about scale.

implicit val chooseByte: Choose[Byte]
implicit val chooseChar: Choose[Char]
implicit val chooseDouble: Choose[Double]
implicit val chooseFiniteDuration: Choose[FiniteDuration]
implicit val chooseFloat: Choose[Float]
implicit val chooseInt: Choose[Int]
implicit val chooseJavaBigDecimal: Choose[BigDecimal]

Choose a java.math.BigDecimal number between two given numbers.

Choose a java.math.BigDecimal number between two given numbers.

See chooseBigDecimal and chooseBigDecimalScale for more comments.

implicit val chooseLong: Choose[Long]
implicit val chooseShort: Choose[Short]