@@ -352,11 +352,14 @@ data Config = Config {
352352 bundleName :: NameAffix ,
353353 -- | Appled to constructor names to get the annotation type family's name
354354 annotationName :: NameAffix ,
355+ -- | If extending a record constructor, apply this to the constructor name
356+ -- to get the annotation field's label.
357+ annotationLabel :: NameAffix ,
355358 -- | Applied to datatype name to get extension constructor & type family's
356359 -- name
357360 extensionName :: NameAffix ,
358- -- | If extending a record constructor , apply this to the constructor name
359- -- to get the extension field's label.
361+ -- | If the extending constructor is a record, apply this to the constructor
362+ -- name to get the extension field's label.
360363 extensionLabel :: NameAffix ,
361364 -- | Applied to datatype name to get extension record name
362365 extRecordName :: NameAffix ,
@@ -384,6 +387,7 @@ data Config = Config {
384387-- constructorName = NameSuffix \"'\",
385388-- bundleName = NameSuffix \"All\",
386389-- annotationName = NamePrefix \"X\",
390+ -- annotationLabel = NamePrefix \"ann\",
387391-- extensionName = NameSuffix \"X\",
388392-- extensionLabel = NamePrefix \"ext\",
389393-- extRecordName = NamePrefix \"Ext\",
@@ -400,6 +404,7 @@ defaultConfig = Config {
400404 constructorName = NameSuffix " '" ,
401405 bundleName = NameSuffix " All" ,
402406 annotationName = NamePrefix " X" ,
407+ annotationLabel = NamePrefix " ann" ,
403408 extensionName = NameSuffix " X" ,
404409 extensionLabel = NamePrefix " ext" ,
405410 extRecordName = NamePrefix " Ext" ,
@@ -570,7 +575,7 @@ extendCon conf nameMap ext tvs (SimpleCon name fields) = do
570575 case fields' of
571576 NormalFields fs -> pure $ NormalC name' $ fs ++ [(strict, extField)]
572577 RecFields fs ->
573- let extLabel = applyAffix (extensionLabel conf) name in
578+ let extLabel = applyAffix (annotationLabel conf) name in
574579 pure $ RecC name' $ fs ++ [(extLabel, strict, extField)]
575580
576581-- | Replaces recursive occurences of the datatype with the new one.
0 commit comments