This introduces a TypeData constructor for DatatypeVariant that characterizes type data declarations (introduced in GHC 9.6). Because type data data constructors only exist at the type level, not the value level, it doesn't make sense to define ToJSON or FromJSON instances for a type data declaration. As a result, this patch makes it an error to use aeson's TH machinery in conjunction with a type data declaration.
This introduces a
TypeData
constructor forDatatypeVariant
that characterizestype data
declarations (introduced in GHC 9.6). Becausetype data
data constructors only exist at the type level, not the value level, it doesn't make sense to defineToJSON
orFromJSON
instances for atype data
declaration. As a result, this patch makes it an error to useaeson
's TH machinery in conjunction with atype data
declaration.