Choose

org.scalacheck.Gen.Choose
See theChoose companion trait
object Choose

Provides implicit org.scalacheck.Gen.Choose instances

Attributes

Companion
trait
Source
Gen.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Choose.type

Members list

Type members

Classlikes

class IllegalBoundsError[A](low: A, high: A) extends IllegalArgumentException

Attributes

Source
Gen.scala
Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
object chooseBigInt extends Choose[BigInt]

Attributes

Source
Gen.scala
Supertypes
trait Choose[BigInt]
trait Serializable
class Object
trait Matchable
class Any
Self type

Attributes

Source
Gen.scala
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Self type

Value members

Concrete methods

def xmap[T, U](from: T => U, to: U => T)(implicit 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.

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)

Attributes

Source
Gen.scala

Implicits

Implicits

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.

Attributes

Source
Gen.scala
implicit val chooseByte: Choose[Byte]

Attributes

Source
Gen.scala
implicit val chooseChar: Choose[Char]

Attributes

Source
Gen.scala
implicit val chooseDouble: Choose[Double]

Attributes

Source
Gen.scala

Attributes

Source
Gen.scala
implicit val chooseFloat: Choose[Float]

Attributes

Source
Gen.scala
implicit val chooseInt: Choose[Int]

Attributes

Source
Gen.scala

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.

Attributes

Source
Gen.scala
implicit val chooseLong: Choose[Long]

Attributes

Source
Gen.scala
implicit val chooseShort: Choose[Short]

Attributes

Source
Gen.scala

Inherited implicits

final implicit lazy val chooseInstant: Choose[Instant]

Attributes

Inherited from:
JavaTimeChoose (hidden)
Source
JavaTimeChoose.scala
final implicit lazy val chooseJavaDuration: Choose[Duration]

Attributes

Inherited from:
JavaTimeChoose (hidden)
Source
JavaTimeChoose.scala
final implicit lazy val chooseLocalDate: Choose[LocalDate]

Attributes

Inherited from:
JavaTimeChoose (hidden)
Source
JavaTimeChoose.scala
final implicit lazy val chooseLocalDateTime: Choose[LocalDateTime]

Attributes

Inherited from:
JavaTimeChoose (hidden)
Source
JavaTimeChoose.scala
final implicit lazy val chooseLocalTime: Choose[LocalTime]

Attributes

Inherited from:
JavaTimeChoose (hidden)
Source
JavaTimeChoose.scala
final implicit lazy val chooseMonth: Choose[Month]

Attributes

Inherited from:
JavaTimeChoose (hidden)
Source
JavaTimeChoose.scala
final implicit lazy val chooseMonthDay: Choose[MonthDay]

Attributes

Inherited from:
JavaTimeChoose (hidden)
Source
JavaTimeChoose.scala
final implicit lazy val chooseOffsetDateTime: Choose[OffsetDateTime]

Attributes

Inherited from:
JavaTimeChoose (hidden)
Source
JavaTimeChoose.scala
final implicit lazy val chooseOffsetTime: Choose[OffsetTime]

Attributes

Inherited from:
JavaTimeChoose (hidden)
Source
JavaTimeChoose.scala
final implicit lazy val chooseYear: Choose[Year]

Attributes

Inherited from:
JavaTimeChoose (hidden)
Source
JavaTimeChoose.scala
final implicit lazy val chooseYearMonth: Choose[YearMonth]

Attributes

Inherited from:
JavaTimeChoose (hidden)
Source
JavaTimeChoose.scala
final implicit lazy val chooseZoneOffset: Choose[ZoneOffset]

ZoneOffset values have some unusual semantics when it comes to ordering.

ZoneOffset values have some unusual semantics when it comes to ordering. The short explanation is that (ZoneOffset.MAX < ZoneOffset.MIN) == true. This is because for any given LocalDateTime, that time applied to ZoneOffset.MAX will be an older moment in time than that same LocalDateTime applied to ZoneOffset.MIN.

From the JavaDoc,

"The offsets are compared in the order that they occur for the same time of day around the world. Thus, an offset of +10:00 comes before an offset of +09:00 and so on down to -18:00."

This has the following implication,

 scala> ZoneOffset.MIN
val res0: java.time.ZoneOffset = -18:00

scala> ZoneOffset.MAX
val res1: java.time.ZoneOffset = +18:00

scala> ZoneOffset.MIN.compareTo(ZoneOffset.MAX)
val res3: Int = 129600

This implementation is consistent with that comparison.

Attributes

See also
Inherited from:
JavaTimeChoose (hidden)
Source
JavaTimeChoose.scala
final implicit lazy val chooseZonedDateTime: Choose[ZonedDateTime]

Attributes

Inherited from:
JavaTimeChoose (hidden)
Source
JavaTimeChoose.scala