git.iko.soy/typeable/xml-isogen
on master help sign in
Fix TH compatibility
86ae2ceDenis Redozubov
src/Data/THGen/Compat.hs+1−1
@@ -38,7 +38,7 @@ newtypeD name = TH.newtypeD (return []) name []
38
38
39#if MIN_VERSION_template_haskell(2,11,0)
39#if MIN_VERSION_template_haskell(2,11,0)
40nonStrictType :: TH.TypeQ -> TH.BangTypeQ
40nonStrictType :: TH.TypeQ -> TH.BangTypeQ
41−nonStrictType = TH.bangType (TH.bang TH.noSourceUnpackedness TH.sourceLazy)
41+nonStrictType = TH.bangType (TH.bang TH.noSourceUnpackedness TH.noSourceStrictness)
42#else
42#else
43nonStrictType :: TH.TypeQ -> TH.StrictTypeQ
43nonStrictType :: TH.TypeQ -> TH.StrictTypeQ
44nonStrictType = TH.strictType TH.notStrict
44nonStrictType = TH.strictType TH.notStrict
src/Data/THGen/XML.hs+3−4
@@ -233,7 +233,7 @@ infix 0 =:=
233instance Description PrefixName IsoXmlDescRecord where
233instance Description PrefixName IsoXmlDescRecord where
234 prefixName =:= descRecord =
234 prefixName =:= descRecord =
235 let descRecordParts = descRecord ^. _IsoXmlDescRecord
235 let descRecordParts = descRecord ^. _IsoXmlDescRecord
236− in isoXmlGenerateRecord prefixName (reverse descRecordParts)
236+ in isoXmlGenerateDatatype prefixName (reverse descRecordParts)
237
237
238record :: IsoXmlDescRecord
238record :: IsoXmlDescRecord
239record = IsoXmlDescRecord []
239record = IsoXmlDescRecord []
@@ -312,8 +312,8 @@ isoXmlGenerateEnum (ExhaustivenessName strName' exh) enumCons = do
312 return $ enumDecls ++ [toXmlInst, toXmlAttributeInst,
312 return $ enumDecls ++ [toXmlInst, toXmlAttributeInst,
313 fromDomInst, fromAttributeInst]
313 fromDomInst, fromAttributeInst]
314
314
315−isoXmlGenerateRecord :: PrefixName -> [IsoXmlDescRecordPart] -> TH.DecsQ
315+isoXmlGenerateDatatype :: PrefixName -> [IsoXmlDescRecordPart] -> TH.DecsQ
316−isoXmlGenerateRecord (PrefixName strName' strPrefix') descRecordParts = do
316+isoXmlGenerateDatatype (PrefixName strName' strPrefix') descRecordParts = do
317 let
317 let
318 isNewtype = length descRecordParts == 1
318 isNewtype = length descRecordParts == 1
319 strName = "Xml" ++ strName'
319 strName = "Xml" ++ strName'
@@ -347,7 +347,6 @@ isoXmlGenerateRecord (PrefixName strName' strPrefix') descRecordParts = do
347 XmlAttributePluralOptional -> [t| Maybe $attributeType |]
347 XmlAttributePluralOptional -> [t| Maybe $attributeType |]
348 in
348 in
349 varStrictType fName (strictType fType)
349 varStrictType fName (strictType fType)
350−<<<<<<< HEAD
351 dataD
350 dataD
352 name
351 name
353 [TH.recC name fields]
352 [TH.recC name fields]