ArbitraryDerivation

scalus.testing.ArbitraryDerivation
object ArbitraryDerivation extends AutoDerivation[Arbitrary]

Derives an Arbitrary instance for a given type T using Magnolia.

Attributes

Example
   given Arbitrary[AddrKeyHash] = ArbitraryDerivation.autoDerived[AddrKeyHash]
Graph
Supertypes
trait AutoDerivation[Arbitrary]
trait Derivation[Arbitrary]
trait SealedTraitDerivation
trait CommonDerivation[Arbitrary]
class Object
trait Matchable
class Any
Show all
Self type

Members list

Type members

Classlikes

object Fallback

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Fallback.type
sealed trait Fallback[+T] extends Serializable

Attributes

Companion
object
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Known subtypes
object NoFallback

Inherited types

type Typeclass[T] = Arbitrary[T]

Attributes

Inherited from:
CommonDerivation

Value members

Concrete methods

def join[T](caseClass: CaseClass[Arbitrary, T]): Arbitrary[T]

Magnolia callback: derives an Arbitrary[T] for a product type by recursively combining generators for each field. Falls back to the implicit Fallback[T] once the size budget is exhausted to avoid unbounded recursion.

Magnolia callback: derives an Arbitrary[T] for a product type by recursively combining generators for each field. Falls back to the implicit Fallback[T] once the size budget is exhausted to avoid unbounded recursion.

Attributes

def split[T](sealedTrait: SealedTrait[Arbitrary, T]): Arbitrary[T]

Magnolia callback: derives an Arbitrary[T] for a sum type by uniformly choosing one of its subtypes and delegating to that subtype's generator. Falls back to the implicit Fallback[T] once the size budget is exhausted to avoid unbounded recursion.

Magnolia callback: derives an Arbitrary[T] for a sum type by uniformly choosing one of its subtypes and delegating to that subtype's generator. Falls back to the implicit Fallback[T] once the size budget is exhausted to avoid unbounded recursion.

Attributes

Inherited methods

inline def `getParams__`[T, Labels <: Tuple, Params <: Tuple](annotations: Map[String, List[Any]], inheritedAnnotations: Map[String, List[Any]], typeAnnotations: Map[String, List[Any]], repeated: Map[String, Boolean], defaults: Map[String, Option[() => Any]], idx: Int = ...): List[Param[Typeclass, T]]

Attributes

Inherited from:
CommonDerivation
inline override protected def deriveSubtype[s](m: Of[s]): Arbitrary[s]

Attributes

Definition Classes
Derivation -> SealedTraitDerivation
Inherited from:
Derivation
inline def derived[A](using Of[A]): Arbitrary[A]

Attributes

Inherited from:
Derivation
inline def derivedMirror[A](using mirror: Of[A]): Arbitrary[A]

Attributes

Inherited from:
Derivation
inline def derivedMirrorProduct[A](product: ProductOf[A]): Arbitrary[A]

Attributes

Inherited from:
CommonDerivation
inline def derivedMirrorSum[A](sum: SumOf[A]): Arbitrary[A]

Attributes

Inherited from:
Derivation
inline def getParams[T, Labels <: Tuple, Params <: Tuple](annotations: Map[String, List[Any]], typeAnnotations: Map[String, List[Any]], repeated: Map[String, Boolean], idx: Int = ...): List[Param[Typeclass, T]]

Attributes

Inherited from:
CommonDerivation
inline def getParams_[T, Labels <: Tuple, Params <: Tuple](annotations: Map[String, List[Any]], inheritedAnnotations: Map[String, List[Any]], typeAnnotations: Map[String, List[Any]], repeated: Map[String, Boolean], idx: Int = ...): List[Param[Typeclass, T]]

Attributes

Inherited from:
CommonDerivation
inline protected def sealedTraitFromMirror[A](m: SumOf[A]): SealedTrait[Typeclass, A]

Attributes

Inherited from:
SealedTraitDerivation
transparent inline def subtypes[T, SubtypeTuple <: Tuple](m: SumOf[T], idx: Int = ...): List[Subtype[Typeclass, T, _]]

Attributes

Inherited from:
Derivation
transparent inline protected def subtypesFromMirror[A, SubtypeTuple <: Tuple](m: SumOf[A], idx: Int = ..., result: List[Subtype[Typeclass, A, _]] = ...): List[Subtype[Typeclass, A, _]]

This method unrolls recursion by 16, 4, 1 steps to increase maximal size of SubtypeTuple tuple due to compiler limitation of maximal nested inlines.

This method unrolls recursion by 16, 4, 1 steps to increase maximal size of SubtypeTuple tuple due to compiler limitation of maximal nested inlines.

Attributes

Inherited from:
SealedTraitDerivation
inline protected def subtypesFromMirrorStep[A, s](m: SumOf[A], idx: Int): List[Subtype[Typeclass, A, _]]

Attributes

Inherited from:
SealedTraitDerivation

Givens

Inherited givens

inline given autoDerived[A](using Of[A]): Arbitrary[A]

Attributes

Inherited from:
AutoDerivation