io.github.martinhh.derived.scalacheck$
Public "API-entry-point" for derivation of scalacheck-typeclass-instances.
(Currently, only Arbitrary
is supported. But in future versions of this library, this may
become the single entry-point for derivation of all of them.)
Attributes Graph Reset zoom Hide graph Show graph
Supertypes Self type Members list Concise view
Value members
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) Givens
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)