haskell / aeson

A fast Haskell JSON library
Other
1.26k stars 321 forks source link

Support building with `th-abstraction-0.5.*` #1006

Closed RyanGlScott closed 1 year ago

RyanGlScott commented 1 year ago

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.