)
-wrapIntoModule :: Arrow a => a (Module, (HsName, (HsQualType, HsExp))) HsModule
-wrapIntoModule = proc (modName, (symName, (symType, symExp))) ->
+wrapIntoModule :: Arrow a => a (Module, ([HsImportDecl], (HsName, (HsQualType, HsExp)))) HsModule
+wrapIntoModule = proc (modName, (extImports, (symName, (symType, symExp)))) ->
do let hsModule = HsModule undefined modName (Just exports) imports decls
exports = [HsEVar (UnQual symName)]
imports = [ HsImportDecl undefined (Module "Text.XML.HXT.Arrow") False Nothing Nothing
, HsImportDecl undefined (Module "Text.XML.HXT.DOM.XmlNode") True (Just (Module "XN")) Nothing
- ]
+ ] ++ extImports
decls = [ HsTypeSig undefined [symName] symType
, HsFunBind [HsMatch undefined symName [] (HsUnGuardedRhs symExp) []]
]