haskell / aeson

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

Getting issue while creating to create ToJSON instance using aeson template in `aeson-1.4.7.1` #1074

Open adiR28 opened 1 year ago

adiR28 commented 1 year ago

getting error while trying to create ToJSON instance for type Exp. using aeson 1.4.7.1

import qualified Data.Aeson.TH as AesonTH
import Data.Functor.Identity as DF

data ExpT f = 
  ExpT
    {
      name :: f Text,
      age :: f Int
    } deriving (Generic)  

type Exp = ExpT DF.Identity

deriving instance Eq Exp

$(AesonTH.deriveToJSON AesonTH.defaultOptions ''ExpT)

getting error normalizeDecFor: DataD or NewtypeD required