DeriveDiff

zio.test.magnolia.DeriveDiff

Attributes

Source
DeriveDiff.scala
Graph
Supertypes
trait LowPri
trait Derivation[Diff]
class Object
trait Matchable
class Any
Show all
Self type
DeriveDiff.type

Members list

Type members

Inherited types

type Typeclass[T] = Diff[T]

Attributes

Inherited from:
CommonDerivation
Source
magnolia.scala

Value members

Concrete methods

def join[A](caseClass: CaseClass[Diff, A]): Diff[A]

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

Source
DeriveDiff.scala
def split[A](ctx: SealedTrait[Diff, A]): Diff[A]

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

Source
DeriveDiff.scala

Inherited methods

inline override protected def deriveSubtype[s](m: Of[s]): Diff[s]

Attributes

Definition Classes
Inherited from:
Derivation
Source
magnolia.scala
inline def derived[A](using Of[A]): Diff[A]

Attributes

Inherited from:
Derivation
Source
magnolia.scala
inline def derivedMirror[A](using mirror: Of[A]): Diff[A]

Attributes

Inherited from:
Derivation
Source
magnolia.scala

Attributes

Inherited from:
CommonDerivation
Source
magnolia.scala
inline def derivedMirrorSum[A](sum: SumOf[A]): Diff[A]

Attributes

Inherited from:
Derivation
Source
magnolia.scala

Attributes

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

Attributes

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

Attributes

Inherited from:
Derivation
Source
magnolia.scala
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
Source
impl.scala
inline protected def subtypesFromMirrorStep[A, s](m: SumOf[A], idx: Int): List[Subtype[Typeclass, A, _]]

Attributes

Inherited from:
SealedTraitDerivation
Source
impl.scala

Givens

Inherited givens

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

Attributes

Inherited from:
AutoDerivation
Source
magnolia.scala
given fallback[A]: Diff[A]

Attributes

Inherited from:
LowPri
Source
DeriveDiff.scala

Implicits

Implicits

implicit inline def gen[A : Of]: Diff[A]

Attributes

Source
DeriveDiff.scala