The generic representation type for {T}, which will be composed of {Coproduct} and {HList} types
The generic representation type for {T}, which will be composed of {Coproduct} and {HList} types
Convert an instance of the generic representation to an instance of the concrete type
Convert an instance of the generic representation to an instance of the concrete type
Convert an instance of the concrete type to the generic value representation
Convert an instance of the concrete type to the generic value representation
LabelledGeneric is similar to Generic, but includes information about field names or class names in addition to the raw structure.
Continuing the example from shapeless.Generic, we use LabelledGeneric to convert an object to an shapeless.HList:
Note that the representation does not include the labels! The labels are actually encoded in the generic type representation using shapeless.Witness types.
As with shapeless.Generic, the representation for Animal captures the subclass embedding rather than the fields in the class, using shapeless.Coproduct:
the type which this instance can convert to and from a labelled generic representation