Source

aeson / Data / Aeson / TH.hs

The default branch has multiple heads

Diff from to

File Data/Aeson/TH.hs

 lower-casing them:
 
 @
-$('deriveJSON' 'defaultOptions'{'fieldNameModifier' = 'drop' 4, 'constructorTagModifier' = map toLower} ''D)
+$('deriveJSON' 'defaultOptions'{'fieldLabelModifier' = 'drop' 4, 'constructorTagModifier' = map toLower} ''D)
 @
 
 Now we can use the newly created instances.
                      [|(.=)|]
                      (varE arg)
 
-        toFieldName field = [|T.pack|] `appE` fieldNameExp opts field
+        toFieldName field = [|T.pack|] `appE` fieldLabelExp opts field
 
     match (conP conName $ map varP args)
           ( normalB
                `appE` (litE $ stringL $ show tName)
                `appE` (litE $ stringL $ constructorTagModifier opts $ nameBase conName)
                `appE` (varE obj)
-               `appE` ( [|T.pack|] `appE` fieldNameExp opts field
+               `appE` ( [|T.pack|] `appE` fieldLabelExp opts field
                       )
              | (field, _, _) <- ts
              ]
                 . nameBase
                 . getConName
 
--- | Creates a string literal expression from a record field name.
-fieldNameExp :: Options -- ^ Encoding options
-             -> Name
-             -> Q Exp
-fieldNameExp opts = litE . stringL . fieldNameModifier opts . nameBase
+-- | Creates a string literal expression from a record field label.
+fieldLabelExp :: Options -- ^ Encoding options
+              -> Name
+              -> Q Exp
+fieldLabelExp opts = litE . stringL . fieldLabelModifier opts . nameBase
 
 -- | The name of the outermost 'Value' constructor.
 valueConName :: Value -> String