git.iko.soy/typeable/xml-isogen
on master help sign in
Fix: attribute newtypes generation
397a807Denis Redozubov
src/Data/THGen/XML.hs+3−2
@@ -345,8 +345,9 @@ isoXmlGenerateDatatype (PrefixName strName' strPrefix') descRecordParts = do
345 fType = case attributePlural of
345 fType = case attributePlural of
346 XmlAttributePluralMandatory -> attributeType
346 XmlAttributePluralMandatory -> attributeType
347 XmlAttributePluralOptional -> [t| Maybe $attributeType |]
347 XmlAttributePluralOptional -> [t| Maybe $attributeType |]
348− in
348+ in if isNewtype
349+ then varStrictType fName (nonStrictType fType)
349− varStrictType fName (strictType fType)
350+ else varStrictType fName (strictType fType)
350 if isNewtype
351 if isNewtype
351 -- generate a newtype instead to do less allocations later
352 -- generate a newtype instead to do less allocations later
352 then newtypeD name (TH.recC name fields) [''Eq, ''Show, ''Generic]
353 then newtypeD name (TH.recC name fields) [''Eq, ''Show, ''Generic]