provides the default value for this parameter, as defined in the case class constructor
dereferences a value of the case class type, Type
, to access the value of the parameter
being represented
dereferences a value of the case class type, Type
, to access the value of the parameter
being represented
When programming generically, against an unknown case class, with unknown parameter names and types, it is not possible to directly access the parameter values without reflection, which is undesirable. This method, whose implementation is provided by the Magnolia macro, will dereference a case class instance to access the parameter corresponding to this Param.
Whilst the type of the resultant parameter value cannot be universally known at the use, its
type will be existentially quantified on this Param instance, and the return type of the
corresponding typeclass
method will be existentially quantified on the same value. This is
sufficient for the compiler to determine that the two values are compatible, and the value may
be applied to the typeclass (in whatever way that particular typeclass provides).
the instance of the case class to be dereferenced
the parameter value
the name of the parameter
the typeclass instance associated with this parameter
the typeclass instance associated with this parameter
This is the instance of the type Typeclass[PType]
which will have been discovered by
implicit search, or derived by Magnolia.
Its type is existentially quantified on this Param instance, and depending on the nature of the particular typeclass, it may either accept or produce types which are also existentially quantified on this same Param instance.
represents a parameter of a case class
type constructor for the typeclass being derived
generic type of this parameter