X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=hxt-compile.git;a=blobdiff_plain;f=Text%2FXML%2FHXT%2FCompilation.hs;fp=Text%2FXML%2FHXT%2FCompilation.hs;h=01e13e28b48ead8dd963a5cc6f4220ea75d49e4f;hp=cbcf396b03b57baaabf0eda579874b4c1c77e3e8;hb=fd97e226a965bc39e95b901125ec38f60eeaadfe;hpb=5ccdec1d86b750444704312526a44eb68972027b diff --git a/Text/XML/HXT/Compilation.hs b/Text/XML/HXT/Compilation.hs index cbcf396..01e13e2 100644 --- a/Text/XML/HXT/Compilation.hs +++ b/Text/XML/HXT/Compilation.hs @@ -18,13 +18,13 @@ compileDocument = uniqueNamespacesFromDeclAndQNames ) -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) []] ]