\T)(c) Niklas Broberg 2004-2012$BSD-style (see the file LICENSE.txt)(Niklas Broberg, niklas.broberg@gmail.com experimentalportableNone23468=BJK#=A simple datatype to annotate return values from sub-patterns4A simple annotation datatype for statement contexts.eTransform away occurences of regular patterns from an abstract Haskell module, preserving semantics.VTransform a declaration by transforming subterms that could contain regular patterns.Transform a function "match" by generating pattern guards and declarations representing regular patterns in the argument list. Subterms, such as guards and the right-hand side, are also traversed transformed.Transform and update guards and right-hand side of a function or pattern binding. The supplied list of guards is prepended to the original guards, and subterms are traversed and transformed.Place declarations of postponed regular patterns in a let-expression to make them lazy, in order to make them behave as irrefutable patterns. 2Make pattern binds from postponed regular patterns|Transform expressions by traversing subterms. Of special interest are expressions that contain patterns as subterms, i.e. let, case; and lambda expressions, and also list comprehensions and do-expressions. All other expressions simply transform their sub-expressions, if any. Of special interest are of course also any xml expressions. |Transform expressions by traversing subterms. Of special interest are expressions that contain patterns as subterms, i.e. let, case; and lambda expressions, and also list comprehensions and do-expressions. All other expressions simply transform their sub-expressions, if any. Of special interest are of course also any xml expressions. -Transform pattern bind declarations inside a let-expression by transforming subterms that could appear as regular patterns, as well as transforming the bound pattern itself. The reason we need to do this in a special way is scoping, i.e. in the expression %let a | Just b <- match a = list in b0 the variable b will not be in scope after the inF. And besides, we would be on thin ice even if it was in scope since we are referring to the pattern being bound in the guard that will decide if the pattern will be bound... yikes, why does Haskell allow guards on pattern binds to refer to the patterns being bound, could that ever lead to anything but an infinite loop?? Transform binding of implicit parameters by transforming the expression on the right-hand side. The left-hand side can only be an implicit parameter, so no regular patterns there... Transform statements by traversing and transforming subterms. Since generator statements have slightly different semantics depending on their context, statements are annotated with their context to ensure that the semantics of the resulting statement sequence is correct. The return type is a list since generated guards will be added as statements on the same level as the statement to be transformed.Transform alternatives in a caseS-expression. Patterns are transformed, while other subterms are traversed further.Generate variables as placeholders for any regular patterns, in order to place their evaluation elsewhere. We must likewise move the evaluation of Tags because attribute lookups are force evaluation.!Rename declarations appearing in lets or where clauses.)Move irrefutable regular patterns into a let9-expression instead, to make sure that the semantics of ~ are preserved.kTransform several patterns in the same context, thereby generating any code for matching regular patterns..Transform several patterns in the same context{Transform a pattern by traversing the syntax tree. A regular pattern is translated, other patterns are simply left as is.ATransform away a regular pattern, generating code to replace it.Functions and ids from the Match2 module, used in the generated matching functionsFunctions and ids from the Match2 module, used in the generated matching functionsFunctions and ids from the Match2 module, used in the generated matching functionsFunctions and ids from the Match2 module, used in the generated matching functionsSome magicB gensym-like functions, and functions with related functionality.DCreate an xml tag, given its domain, name, attributes and children.?Create an empty xml tag, given its domain, name and attributes./Create an attribute by applying the overloaded asAttr0Create a property from an attribute and a value.EMake xml out of some expression by applying the overloaded function asChild.  convert a ! literal to lazy Text by calling a function named  fromStringLit"-Lookup an attribute in the set of attributes.#2Generate a pattern under the Tag data constructor.$5Generate a pattern under the PCDATA data constructor.%&'()*+,-./0123456789:;<=>?  @ABCD EFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ "#$%)('&*+,-./0143256789:;<=>?  @ABCD EFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ "#$None23468=BJK1QuasiQuoter which can be used to parse HSX syntax      !"#$%&'()*+,-.//01233456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ hsx2hs-0.13.3Language.Haskell.HSX.TransformLanguage.Haskell.HSX.QQ transform transformExphsxMTypeStmtType transformDecltransformMatchmkRhs addLetDeclsmkDecl transformExpMtransformLetDeclstransformIPBind transformStmt transformAlt renameRPatsrenameLetDecls renameIrrPatstransformPatterns trPatterns trPatterntrRPat runMatchFun baseMatchFun manyMatchFun gManyMatchFunretnamemetaGenElementmetaGenEElement metaAsAttr metaAssign metaAsChildmetaFromStringLitbaseGHC.BaseString metaExtractmetaTag metaPcdata MFunMetaInfoMELSTrStateNameBindRNStateRNGuard ListCompStmt GuardStmtDoStmtHsxStateHsxMMkHsxM getHsxState setHsxState initHsxStatesetHarpTransformedsetXmlTransformedrunHsxMtransformInstDecltransformClassDecltransformFieldUpdatetransformSplice transform2exp transform3expmkAttrtransformQualStmt mkStmtGuard mkDeclGuard initRNState runRename getRNState setRNState genVarName rename1pat rename2pat renameNpatrenameRP renameIrrPliftTr initState initStateFromrunTr runTrFromTogetStatesetState updateState pushGuardpushDecl pushAttrGuard genMatchName genPatName genAttrNamesetHarpTransformedTsetXmlTransformedTtr1pattr2pattrNpat runMatch_namebaseMatch_namemanyMatch_namegManyMatch_name match_modmatch_qual_mod match_qualchoiceOpappendOp foldCompFun mkMetaUnzip matchFunctionvarsnamevalnamevalsname valsvarsname mkValName extendVar xNameParts metaReturn metaConst metaUnzip metaEither metaMaybe metaConcatmetaMap metaAppend metaChoice metaPConsmetaConsmetaComp metaPJust metaPNothing metaPMkMaybemetaJust metaNothing metaMkMaybeconsFunidFunconconsfcompchoiceappend just_name nothing_name left_name right_name argAsAttr metaMkName $fFunctorTr $fMonadTr$fApplicativeTr $fFunctorRN $fMonadRN$fApplicativeRN $fFunctorHsxM $fMonadHsxM$fApplicativeHsxM parseHsxExpparseExp parseHsExp parseMode allExtensions