+
+emptyGroup, emptyRdrGroup, emptyRnGroup :: HsGroup a
+emptyRdrGroup = emptyGroup { hs_valds = emptyValBindsIn }
+emptyRnGroup = emptyGroup { hs_valds = emptyValBindsOut }
+
+emptyGroup = HsGroup { hs_tyclds = [], hs_instds = [],
+ hs_fixds = [], hs_defds = [], hs_fords = [],
+ hs_depds = [] ,hs_ruleds = [] }
+
+appendGroups :: HsGroup a -> HsGroup a -> HsGroup a
+appendGroups
+ HsGroup {
+ hs_valds = val_groups1,
+ hs_tyclds = tyclds1,
+ hs_instds = instds1,
+ hs_fixds = fixds1,
+ hs_defds = defds1,
+ hs_fords = fords1,
+ hs_depds = depds1,
+ hs_ruleds = rulds1 }
+ HsGroup {
+ hs_valds = val_groups2,
+ hs_tyclds = tyclds2,
+ hs_instds = instds2,
+ hs_fixds = fixds2,
+ hs_defds = defds2,
+ hs_fords = fords2,
+ hs_depds = depds2,
+ hs_ruleds = rulds2 }
+ =
+ HsGroup {
+ hs_valds = val_groups1 `plusHsValBinds` val_groups2,
+ hs_tyclds = tyclds1 ++ tyclds2,
+ hs_instds = instds1 ++ instds2,
+ hs_fixds = fixds1 ++ fixds2,
+ hs_defds = defds1 ++ defds2,
+ hs_fords = fords1 ++ fords2,
+ hs_depds = depds1 ++ depds2,
+ hs_ruleds = rulds1 ++ rulds2 }