From fd97e226a965bc39e95b901125ec38f60eeaadfe Mon Sep 17 00:00:00 2001 From: PHO Date: Tue, 9 Mar 2010 15:00:03 +0900 Subject: [PATCH] Forgotten changes to be commited... --- Main.hs | 2 ++ Text/XML/HXT/Compilation.hs | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Main.hs b/Main.hs index 8466f76..3874914 100644 --- a/Main.hs +++ b/Main.hs @@ -19,6 +19,8 @@ main = do let fpath = "examples/tiny.xml" ] >>> ( constA (Module "Foo") + &&& + constA [] &&& constA (HsIdent "foo") &&& 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) []] ] -- 2.40.0