io.github.martinhh.derived.scalacheck$
Public "API-entry-point" for derivation of scalacheck-typeclass-instances.
This does not provide derivation of Shrink
-instances as that might not always be desired. You can opt in to derivation of Shrink
-instances via shrink
.
Attributes
-
Graph
-
-
Supertypes
-
trait Matchable
class Any
-
Self type
-
Members list
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)
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)