-templateHaskellNames
- = mkNameSet [ intLName,charLName, plitName, pvarName, ptupName,
- pconName, ptildeName, paspatName, pwildName,
- varName, conName, litName, appName, infixEName, lamName,
- tupName, doEName, compName,
- listExpName, condName, letEName, caseEName,
- infixAppName, sectionLName, sectionRName, guardedName, normalName,
- bindStName, letStName, noBindStName, parStName,
- fromName, fromThenName, fromToName, fromThenToName,
- funName, valName, liftName,
- gensymName, returnQName, bindQName,
- matchName, clauseName, funName, valName, dataDName, classDName,
- instName, protoName, tvarName, tconName, tappName,
- arrowTyConName, tupleTyConName, listTyConName, namedTyConName,
- constrName,
- exprTyConName, declTyConName, pattTyConName, mtchTyConName,
- clseTyConName, stmtTyConName, consTyConName, typeTyConName,
- qTyConName, expTyConName, matTyConName, clsTyConName,
- decTyConName, typTyConName ]
-
-
-varQual = mk_known_key_name OccName.varName
-tcQual = mk_known_key_name OccName.tcName
-
-thModule :: Module
--- NB: the THSyntax module comes from the "haskell-src" package
-thModule = mkThPkgModule mETA_META_Name
-
-mk_known_key_name space str uniq
- = mkKnownKeyExternalName thModule (mkOccFS space str) uniq
-
-intLName = varQual FSLIT("intL") intLIdKey
-charLName = varQual FSLIT("charL") charLIdKey
-plitName = varQual FSLIT("plit") plitIdKey
-pvarName = varQual FSLIT("pvar") pvarIdKey
-ptupName = varQual FSLIT("ptup") ptupIdKey
-pconName = varQual FSLIT("pcon") pconIdKey
-ptildeName = varQual FSLIT("ptilde") ptildeIdKey
-paspatName = varQual FSLIT("paspat") paspatIdKey
-pwildName = varQual FSLIT("pwild") pwildIdKey
-varName = varQual FSLIT("var") varIdKey
-conName = varQual FSLIT("con") conIdKey
-litName = varQual FSLIT("lit") litIdKey
-appName = varQual FSLIT("app") appIdKey
-infixEName = varQual FSLIT("infixE") infixEIdKey
-lamName = varQual FSLIT("lam") lamIdKey
-tupName = varQual FSLIT("tup") tupIdKey
-doEName = varQual FSLIT("doE") doEIdKey
-compName = varQual FSLIT("comp") compIdKey
-listExpName = varQual FSLIT("listExp") listExpIdKey
-condName = varQual FSLIT("cond") condIdKey
-letEName = varQual FSLIT("letE") letEIdKey
-caseEName = varQual FSLIT("caseE") caseEIdKey
-infixAppName = varQual FSLIT("infixApp") infixAppIdKey
-sectionLName = varQual FSLIT("sectionL") sectionLIdKey
-sectionRName = varQual FSLIT("sectionR") sectionRIdKey
-guardedName = varQual FSLIT("guarded") guardedIdKey
-normalName = varQual FSLIT("normal") normalIdKey
-bindStName = varQual FSLIT("bindSt") bindStIdKey
-letStName = varQual FSLIT("letSt") letStIdKey
-noBindStName = varQual FSLIT("noBindSt") noBindStIdKey
-parStName = varQual FSLIT("parSt") parStIdKey
-fromName = varQual FSLIT("from") fromIdKey
-fromThenName = varQual FSLIT("fromThen") fromThenIdKey
-fromToName = varQual FSLIT("fromTo") fromToIdKey
-fromThenToName = varQual FSLIT("fromThenTo") fromThenToIdKey
-liftName = varQual FSLIT("lift") liftIdKey
-gensymName = varQual FSLIT("gensym") gensymIdKey
-returnQName = varQual FSLIT("returnQ") returnQIdKey
-bindQName = varQual FSLIT("bindQ") bindQIdKey
-
--- type Mat = ...
-matchName = varQual FSLIT("match") matchIdKey
-
--- type Cls = ...
-clauseName = varQual FSLIT("clause") clauseIdKey
-
--- data Dec = ...
-funName = varQual FSLIT("fun") funIdKey
-valName = varQual FSLIT("val") valIdKey
-dataDName = varQual FSLIT("dataD") dataDIdKey
-classDName = varQual FSLIT("classD") classDIdKey
-instName = varQual FSLIT("inst") instIdKey
-protoName = varQual FSLIT("proto") protoIdKey
-
--- data Typ = ...
-tvarName = varQual FSLIT("tvar") tvarIdKey
-tconName = varQual FSLIT("tcon") tconIdKey
-tappName = varQual FSLIT("tapp") tappIdKey
-
--- data Tag = ...
-arrowTyConName = varQual FSLIT("arrowTyCon") arrowIdKey
-tupleTyConName = varQual FSLIT("tupleTyCon") tupleIdKey
-listTyConName = varQual FSLIT("listTyCon") listIdKey
-namedTyConName = varQual FSLIT("namedTyCon") namedTyConIdKey
-
+
+templateHaskellNames = [
+ returnQName, bindQName, sequenceQName, newNameName, liftName,
+ mkNameName, mkNameG_vName, mkNameG_dName, mkNameG_tcName, mkNameUName,
+
+ -- Lit
+ charLName, stringLName, integerLName, intPrimLName,
+ floatPrimLName, doublePrimLName, rationalLName,
+ -- Pat
+ litPName, varPName, tupPName, conPName, tildePName,
+ asPName, wildPName, recPName, listPName,
+ -- FieldPat
+ fieldPatName,
+ -- Match
+ matchName,
+ -- Clause
+ clauseName,
+ -- Exp
+ varEName, conEName, litEName, appEName, infixEName,
+ infixAppName, sectionLName, sectionRName, lamEName, tupEName,
+ condEName, letEName, caseEName, doEName, compEName,
+ fromEName, fromThenEName, fromToEName, fromThenToEName,
+ listEName, sigEName, recConEName, recUpdEName,
+ -- FieldExp
+ fieldExpName,
+ -- Body
+ guardedBName, normalBName,
+ -- Stmt
+ bindSName, letSName, noBindSName, parSName,
+ -- Dec
+ funDName, valDName, dataDName, newtypeDName, tySynDName,
+ classDName, instanceDName, sigDName,
+ -- Cxt
+ cxtName,
+ -- Strict
+ isStrictName, notStrictName,
+ -- Con
+ normalCName, recCName, infixCName,
+ -- StrictType
+ strictTypeName,
+ -- VarStrictType
+ varStrictTypeName,
+ -- Type
+ forallTName, varTName, conTName, appTName,
+ tupleTName, arrowTName, listTName,
+
+ -- And the tycons
+ qTyConName, nameTyConName, patTyConName, fieldPatTyConName, matchQTyConName,
+ clauseQTyConName, expQTyConName, fieldExpTyConName, stmtQTyConName,
+ decQTyConName, conQTyConName, strictTypeQTyConName,
+ varStrictTypeQTyConName, typeQTyConName, expTyConName, decTyConName,
+ typeTyConName, matchTyConName, clauseTyConName]
+
+tH_SYN_Name = mkModuleName "Language.Haskell.TH.Syntax"
+tH_LIB_Name = mkModuleName "Language.Haskell.TH.Lib"
+
+thSyn :: Module
+-- NB: the TH.Syntax module comes from the "haskell-src" package
+thSyn = mkModule thPackage tH_SYN_Name
+thLib = mkModule thPackage tH_LIB_Name
+
+mk_known_key_name mod space str uniq
+ = mkExternalName uniq mod (mkOccFS space str)
+ Nothing noSrcLoc
+
+libFun = mk_known_key_name thLib OccName.varName
+libTc = mk_known_key_name thLib OccName.tcName
+thFun = mk_known_key_name thSyn OccName.varName
+thTc = mk_known_key_name thSyn OccName.tcName
+
+-------------------- TH.Syntax -----------------------
+qTyConName = thTc FSLIT("Q") qTyConKey
+nameTyConName = thTc FSLIT("Name") nameTyConKey
+fieldExpTyConName = thTc FSLIT("FieldExp") fieldExpTyConKey
+patTyConName = thTc FSLIT("Pat") patTyConKey
+fieldPatTyConName = thTc FSLIT("FieldPat") fieldPatTyConKey
+expTyConName = thTc FSLIT("Exp") expTyConKey
+decTyConName = thTc FSLIT("Dec") decTyConKey
+typeTyConName = thTc FSLIT("Type") typeTyConKey
+matchTyConName = thTc FSLIT("Match") matchTyConKey
+clauseTyConName = thTc FSLIT("Clause") clauseTyConKey
+
+returnQName = thFun FSLIT("returnQ") returnQIdKey
+bindQName = thFun FSLIT("bindQ") bindQIdKey
+sequenceQName = thFun FSLIT("sequenceQ") sequenceQIdKey
+newNameName = thFun FSLIT("newName") newNameIdKey
+liftName = thFun FSLIT("lift") liftIdKey
+mkNameName = thFun FSLIT("mkName") mkNameIdKey
+mkNameG_vName = thFun FSLIT("mkNameG_v") mkNameG_vIdKey
+mkNameG_dName = thFun FSLIT("mkNameG_d") mkNameG_dIdKey
+mkNameG_tcName = thFun FSLIT("mkNameG_tc") mkNameG_tcIdKey
+mkNameUName = thFun FSLIT("mkNameU") mkNameUIdKey
+
+
+-------------------- TH.Lib -----------------------
+-- data Lit = ...
+charLName = libFun FSLIT("charL") charLIdKey
+stringLName = libFun FSLIT("stringL") stringLIdKey
+integerLName = libFun FSLIT("integerL") integerLIdKey
+intPrimLName = libFun FSLIT("intPrimL") intPrimLIdKey
+floatPrimLName = libFun FSLIT("floatPrimL") floatPrimLIdKey
+doublePrimLName = libFun FSLIT("doublePrimL") doublePrimLIdKey
+rationalLName = libFun FSLIT("rationalL") rationalLIdKey
+
+-- data Pat = ...
+litPName = libFun FSLIT("litP") litPIdKey
+varPName = libFun FSLIT("varP") varPIdKey
+tupPName = libFun FSLIT("tupP") tupPIdKey
+conPName = libFun FSLIT("conP") conPIdKey
+tildePName = libFun FSLIT("tildeP") tildePIdKey
+asPName = libFun FSLIT("asP") asPIdKey
+wildPName = libFun FSLIT("wildP") wildPIdKey
+recPName = libFun FSLIT("recP") recPIdKey
+listPName = libFun FSLIT("listP") listPIdKey
+
+-- type FieldPat = ...
+fieldPatName = libFun FSLIT("fieldPat") fieldPatIdKey
+
+-- data Match = ...
+matchName = libFun FSLIT("match") matchIdKey
+
+-- data Clause = ...
+clauseName = libFun FSLIT("clause") clauseIdKey
+
+-- data Exp = ...
+varEName = libFun FSLIT("varE") varEIdKey
+conEName = libFun FSLIT("conE") conEIdKey
+litEName = libFun FSLIT("litE") litEIdKey
+appEName = libFun FSLIT("appE") appEIdKey
+infixEName = libFun FSLIT("infixE") infixEIdKey
+infixAppName = libFun FSLIT("infixApp") infixAppIdKey
+sectionLName = libFun FSLIT("sectionL") sectionLIdKey
+sectionRName = libFun FSLIT("sectionR") sectionRIdKey
+lamEName = libFun FSLIT("lamE") lamEIdKey
+tupEName = libFun FSLIT("tupE") tupEIdKey
+condEName = libFun FSLIT("condE") condEIdKey
+letEName = libFun FSLIT("letE") letEIdKey
+caseEName = libFun FSLIT("caseE") caseEIdKey
+doEName = libFun FSLIT("doE") doEIdKey
+compEName = libFun FSLIT("compE") compEIdKey
+-- ArithSeq skips a level
+fromEName = libFun FSLIT("fromE") fromEIdKey
+fromThenEName = libFun FSLIT("fromThenE") fromThenEIdKey
+fromToEName = libFun FSLIT("fromToE") fromToEIdKey
+fromThenToEName = libFun FSLIT("fromThenToE") fromThenToEIdKey
+-- end ArithSeq
+listEName = libFun FSLIT("listE") listEIdKey
+sigEName = libFun FSLIT("sigE") sigEIdKey
+recConEName = libFun FSLIT("recConE") recConEIdKey
+recUpdEName = libFun FSLIT("recUpdE") recUpdEIdKey
+
+-- type FieldExp = ...
+fieldExpName = libFun FSLIT("fieldExp") fieldExpIdKey
+
+-- data Body = ...
+guardedBName = libFun FSLIT("guardedB") guardedBIdKey
+normalBName = libFun FSLIT("normalB") normalBIdKey
+
+-- data Stmt = ...
+bindSName = libFun FSLIT("bindS") bindSIdKey
+letSName = libFun FSLIT("letS") letSIdKey
+noBindSName = libFun FSLIT("noBindS") noBindSIdKey
+parSName = libFun FSLIT("parS") parSIdKey
+
+-- data Dec = ...
+funDName = libFun FSLIT("funD") funDIdKey
+valDName = libFun FSLIT("valD") valDIdKey
+dataDName = libFun FSLIT("dataD") dataDIdKey
+newtypeDName = libFun FSLIT("newtypeD") newtypeDIdKey
+tySynDName = libFun FSLIT("tySynD") tySynDIdKey
+classDName = libFun FSLIT("classD") classDIdKey
+instanceDName = libFun FSLIT("instanceD") instanceDIdKey
+sigDName = libFun FSLIT("sigD") sigDIdKey
+
+-- type Ctxt = ...
+cxtName = libFun FSLIT("cxt") cxtIdKey
+
+-- data Strict = ...
+isStrictName = libFun FSLIT("isStrict") isStrictKey
+notStrictName = libFun FSLIT("notStrict") notStrictKey
+