ArbitraryDerivation
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 SealedTraitDerivationtrait CommonDerivation[Arbitrary]class Objecttrait Matchableclass AnyShow all
- Self type
-
ArbitraryDerivation.type
Members list
Type members
Classlikes
Attributes
- Companion
- object
- Supertypes
-
trait Serializableclass Objecttrait Matchableclass Any
- Known subtypes
-
object NoFallback
Inherited types
Attributes
- Inherited from:
- CommonDerivation
Value members
Concrete methods
Must be implemented by the user of Magnolia to construct a typeclass for case class T using the provided type info. E.g. if we are deriving Show[T] typeclasses, and T is a case class Foo(...), we need to constuct Show[Foo].
Must be implemented by the user of Magnolia to construct a typeclass for case class T using the provided type info. E.g. if we are deriving Show[T] typeclasses, and T is a case class Foo(...), we need to constuct Show[Foo].
This method is called 'join' because typically it will join together the typeclasses for all the parameters of the case class, into a single typeclass for the case class itself. The field CaseClass.params can provide useful information for doing this.
Value parameters
- caseClass
-
information about the case class
T, its parameters, and their typeclasses
Attributes
This must be implemented by the user of Magnolia to construct a Typeclass for 'T', where 'T' is a Sealed Trait or Scala 3 Enum, using the provided type info. E.g. if we are deriving 'Show[T]' typeclasses, and T is an enum 'Suit' (eg with values Diamonds, Clubs, etc), we need to constuct 'Show[Suit]'.
This must be implemented by the user of Magnolia to construct a Typeclass for 'T', where 'T' is a Sealed Trait or Scala 3 Enum, using the provided type info. E.g. if we are deriving 'Show[T]' typeclasses, and T is an enum 'Suit' (eg with values Diamonds, Clubs, etc), we need to constuct 'Show[Suit]'.
This method is called 'split' because it will ''split'' the different possible types of the SealedTrait, and handle each one to finally produce a typeclass capable of handling any possible subtype of the trait.
A useful function for implementing this method is SealedTrait#choose, which can take a value instance and provide information on the specific subtype of the sealedTrait which that value is.
Attributes
Inherited methods
Attributes
- Inherited from:
- CommonDerivation
Attributes
- Definition Classes
-
Derivation -> SealedTraitDerivation
- Inherited from:
- Derivation
Attributes
- Inherited from:
- Derivation
Attributes
- Inherited from:
- Derivation
Attributes
- Inherited from:
- CommonDerivation
Attributes
- Inherited from:
- Derivation
Attributes
- Inherited from:
- CommonDerivation
Attributes
- Inherited from:
- CommonDerivation
Attributes
- Inherited from:
- SealedTraitDerivation
Attributes
- Inherited from:
- Derivation
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
Attributes
- Inherited from:
- SealedTraitDerivation
Givens
Inherited givens
Attributes
- Inherited from:
- AutoDerivation