scalacheck

io.github.martinhh.derived.scalacheck$
object scalacheck extends CogenDeriving

Public "API-entry-point" for derivation of scalacheck-typeclass-instances.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Value members

Inherited methods

inline def deriveArbitrary[T](using m: Of[T]): Arbitrary[T]

Derives an Arbitrary[T], ignoring any given Arbitrary[T] that is already in scope.

Derives an Arbitrary[T], ignoring any given Arbitrary[T] that is already in scope.

This can be used to explicitly create given instances:

 case class Point(x: Double, y: Double)
 given Arbitrary[Point] = deriveArbitrary

Attributes

Inherited from:
ArbitraryDeriving (hidden)
inline def deriveCogen[T](using m: Of[T]): Cogen[T]

Attributes

Inherited from:
CogenDeriving

Givens

Inherited givens

inline given anyGivenArbitrary[T]: Arbitrary[T]

Resolves an Arbitrary[T], using existing given instances or falling back to derivation.

Resolves an Arbitrary[T], using existing given instances or falling back to derivation.

Existing given instances (that are in scope) will be preferred over derivation.

Importing this will add derivation as fallback to implicit resolution of Arbitrary- instances.

Note that the following will not work and result in an "Infinite loop in function body":

 case class Point(x: Double, y: Double)
 given Arbitrary[Point] = anyGivenArbitrary

If you intend to derive Arbitrary-instances in that way, use deriveArbitrary instead.

Attributes

Inherited from:
ArbitraryDeriving (hidden)
inline given anyGivenCogen[T]: Cogen[T]

Attributes

Inherited from:
CogenDeriving