1 module Text.XML.HXT.Compilation
7 import Language.Haskell.Syntax
8 import Text.XML.HXT.Arrow
9 import Text.XML.HXT.Compilation.XmlTree
12 compileDocument :: ArrowXml a => a XmlTree (HsQualType, HsExp)
13 compileDocument = uniqueNamespacesFromDeclAndQNames
15 ( constA (HsQualType [] (HsTyCon (UnQual (HsIdent "XmlTree"))))
21 wrapIntoModule :: Arrow a => a (Module, (HsName, (HsQualType, HsExp))) HsModule
22 wrapIntoModule = proc (modName, (symName, (symType, symExp))) ->
23 do let hsModule = HsModule undefined modName (Just exports) imports decls
24 exports = [HsEVar (UnQual symName)]
25 imports = [ HsImportDecl undefined (Module "Text.XML.HXT.Arrow") False Nothing Nothing
26 , HsImportDecl undefined (Module "Text.XML.HXT.DOM.XmlNode") True (Just (Module "XN")) Nothing
28 decls = [ HsTypeSig undefined [symName] symType
29 , HsFunBind [HsMatch undefined symName [] (HsUnGuardedRhs symExp) []]