Note [Generics and unlifted types]
Normally, all constants are marked with K1/Rec0. The exception to this rule is when a data constructor has an unlifted argument (e.g., Int#, Char#, etc.). In that case, we must use a data family instance of URec (from GHC.Generics) to mark it. As a result, before we can generate K1 or unK1, we must first check to see if the type is actually one of the unlifted types for which URec has a data family instance; if so, we generate that instead. See wiki:commentary/compiler/generic-deriving#handling-unlifted-types for more details on why URec is implemented the way it is.
References 0
This Note does not link to any other.
Referenced by 3
- GHC.Tc.Deriv.Generics call site ×2
- Requirements for deriving Generic and Rep GHC.Tc.Deriv.Generics