summaryrefslogtreecommitdiff
path: root/compiler/prelude
diff options
context:
space:
mode:
authorAustin Seipp <austin@well-typed.com>2015-05-14 10:55:03 -0500
committerAustin Seipp <austin@well-typed.com>2015-05-14 10:55:03 -0500
commit3cf8ecdc70cb295a2b9606080a1c7b5fa8eb16f4 (patch)
treee7989a081754885163e9dc20a6545820ebeab532 /compiler/prelude
parent04a484eafc9eb9f8774b4bdd41a5dc6c9f640daf (diff)
downloadhaskell-3cf8ecdc70cb295a2b9606080a1c7b5fa8eb16f4.tar.gz
Revert multiple commits
This reverts multiple commits from Simon: - 04a484eafc9eb9f8774b4bdd41a5dc6c9f640daf Test Trac #10359 - a9ccd37add8315e061c02e5bf26c08f05fad9ac9 Test Trac #10403 - c0aae6f699cbd222d826d0b8d78d6cb3f682079e Test Trac #10248 - eb6ca851f553262efe0824b8dcbe64952de4963d Make the "matchable-given" check happen first - ca173aa30467a0b1023682d573fcd94244d85c50 Add a case to checkValidTyCon - 51cbad15f86fca1d1b0e777199eb1079a1b64d74 Update haddock submodule - 6e1174da5b8e0b296f5bfc8b39904300d04eb5b7 Separate transCloVarSet from fixVarSet - a8493e03b89f3b3bfcdb6005795de050501f5c29 Fix imports in HscMain (stage2) - a154944bf07b2e13175519bafebd5a03926bf105 Two wibbles to fix the build - 5910a1bc8142b4e56a19abea104263d7bb5c5d3f Change in capitalisation of error msg - 130e93aab220bdf14d08028771f83df210da340b Refactor tuple constraints - 8da785d59f5989b9a9df06386d5bd13f65435bc0 Delete commented-out line These break the build by causing Haddock to fail mysteriously when trying to examine GHC.Prim it seems.
Diffstat (limited to 'compiler/prelude')
-rw-r--r--compiler/prelude/PrelInfo.hs28
-rw-r--r--compiler/prelude/PrelNames.hs17
-rw-r--r--compiler/prelude/PrelRules.hs6
-rw-r--r--compiler/prelude/PrimOp.hs2
-rw-r--r--compiler/prelude/THNames.hs836
-rw-r--r--compiler/prelude/TysWiredIn.hs269
6 files changed, 133 insertions, 1025 deletions
diff --git a/compiler/prelude/PrelInfo.hs b/compiler/prelude/PrelInfo.hs
index 4d1cd9af95..2303a8edd3 100644
--- a/compiler/prelude/PrelInfo.hs
+++ b/compiler/prelude/PrelInfo.hs
@@ -10,7 +10,7 @@ module PrelInfo (
primOpRules, builtinRules,
ghcPrimExports,
- wiredInThings, knownKeyNames,
+ wiredInThings, basicKnownKeyNames,
primOpId,
-- Random other things
@@ -30,7 +30,6 @@ import PrimOp
import DataCon
import Id
import MkId
-import Name( Name, getName )
import TysPrim
import TysWiredIn
import HscTypes
@@ -39,31 +38,12 @@ import TyCon
import Util
import {-# SOURCE #-} TcTypeNats ( typeNatTyCons )
-#ifdef GHCI
-import THNames
-#endif
-
import Data.Array
-
-{- *********************************************************************
-* *
- Known key things
-* *
-********************************************************************* -}
-
-knownKeyNames :: [Name]
-knownKeyNames
- = map getName wiredInThings
- ++ cTupleTyConNames
- ++ basicKnownKeyNames
-#ifdef GHCI
- ++ templateHaskellNames
-#endif
-
-{- *********************************************************************
+{-
+************************************************************************
* *
- Wired in things
+\subsection[builtinNameInfo]{Lookup built-in names}
* *
************************************************************************
diff --git a/compiler/prelude/PrelNames.hs b/compiler/prelude/PrelNames.hs
index ded9583c62..113dfdc507 100644
--- a/compiler/prelude/PrelNames.hs
+++ b/compiler/prelude/PrelNames.hs
@@ -121,6 +121,7 @@ import Module
import OccName
import RdrName
import Unique
+import BasicTypes
import Name
import SrcLoc
import FastString
@@ -519,6 +520,19 @@ mkMainModule_ m = mkModule mainPackageKey m
{-
************************************************************************
* *
+\subsection{Constructing the names of tuples
+* *
+************************************************************************
+-}
+
+mkTupleModule :: TupleSort -> Module
+mkTupleModule BoxedTuple = gHC_TUPLE
+mkTupleModule ConstraintTuple = gHC_TUPLE
+mkTupleModule UnboxedTuple = gHC_PRIM
+
+{-
+************************************************************************
+* *
RdrNames
* *
************************************************************************
@@ -1558,6 +1572,9 @@ typeRepTyConKey = mkPreludeTyConUnique 183
#include "primop-vector-uniques.hs-incl"
+unitTyConKey :: Unique
+unitTyConKey = mkTupleTyConUnique BoxedTuple 0
+
{-
************************************************************************
* *
diff --git a/compiler/prelude/PrelRules.hs b/compiler/prelude/PrelRules.hs
index 1ab8543afc..5c6b70072b 100644
--- a/compiler/prelude/PrelRules.hs
+++ b/compiler/prelude/PrelRules.hs
@@ -907,7 +907,7 @@ seqRule :: RuleM CoreExpr
seqRule = do
[ty_a, Type ty_s, a, s] <- getArgs
guard $ exprIsHNF a
- return $ mkConApp (tupleDataCon Unboxed 2)
+ return $ mkConApp (tupleCon UnboxedTuple 2)
[Type (mkStatePrimTy ty_s), ty_a, s, a]
-- spark# :: forall a s . a -> State# s -> (# State# s, a #)
@@ -1224,7 +1224,7 @@ match_Integer_divop_both divop _ id_unf _ [xl,yl]
, Just (LitInteger y _) <- exprIsLiteral_maybe id_unf yl
, y /= 0
, (r,s) <- x `divop` y
- = Just $ mkConApp (tupleDataCon Unboxed 2)
+ = Just $ mkConApp (tupleCon UnboxedTuple 2)
[Type t,
Type t,
Lit (LitInteger r t),
@@ -1300,7 +1300,7 @@ match_decodeDouble _ id_unf fn [xl]
FunTy _ (TyConApp _ [integerTy, intHashTy]) ->
case decodeFloat (fromRational x :: Double) of
(y, z) ->
- Just $ mkConApp (tupleDataCon Unboxed 2)
+ Just $ mkConApp (tupleCon UnboxedTuple 2)
[Type integerTy,
Type intHashTy,
Lit (LitInteger y integerTy),
diff --git a/compiler/prelude/PrimOp.hs b/compiler/prelude/PrimOp.hs
index dbeade27bc..de6d49b96a 100644
--- a/compiler/prelude/PrimOp.hs
+++ b/compiler/prelude/PrimOp.hs
@@ -34,7 +34,7 @@ import OccName ( OccName, pprOccName, mkVarOccFS )
import TyCon ( TyCon, isPrimTyCon, tyConPrimRep, PrimRep(..) )
import Type ( Type, mkForAllTys, mkFunTy, mkFunTys, tyConAppTyCon,
typePrimRep )
-import BasicTypes ( Arity, Fixity(..), FixityDirection(..), Boxity(..) )
+import BasicTypes ( Arity, Fixity(..), FixityDirection(..), TupleSort(..) )
import ForeignCall ( CLabelString )
import Unique ( Unique, mkPrimOpIdUnique )
import Outputable
diff --git a/compiler/prelude/THNames.hs b/compiler/prelude/THNames.hs
deleted file mode 100644
index 5ccfaeb3e8..0000000000
--- a/compiler/prelude/THNames.hs
+++ /dev/null
@@ -1,836 +0,0 @@
--- %************************************************************************
--- %* *
--- The known-key names for Template Haskell
--- %* *
--- %************************************************************************
-
-module THNames where
-
-import PrelNames( mk_known_key_name )
-import Module( Module, mkModuleNameFS, mkModule, thPackageKey )
-import Name( Name )
-import OccName( tcName, dataName, varName )
-import Unique
-import FastString
-
--- To add a name, do three things
---
--- 1) Allocate a key
--- 2) Make a "Name"
--- 3) Add the name to knownKeyNames
-
-templateHaskellNames :: [Name]
--- The names that are implicitly mentioned by ``bracket''
--- Should stay in sync with the import list of DsMeta
-
-templateHaskellNames = [
- returnQName, bindQName, sequenceQName, newNameName, liftName,
- mkNameName, mkNameG_vName, mkNameG_dName, mkNameG_tcName, mkNameLName,
- liftStringName,
- unTypeName,
- unTypeQName,
- unsafeTExpCoerceName,
-
- -- Lit
- charLName, stringLName, integerLName, intPrimLName, wordPrimLName,
- floatPrimLName, doublePrimLName, rationalLName,
- -- Pat
- litPName, varPName, tupPName, unboxedTupPName,
- conPName, tildePName, bangPName, infixPName,
- asPName, wildPName, recPName, listPName, sigPName, viewPName,
- -- FieldPat
- fieldPatName,
- -- Match
- matchName,
- -- Clause
- clauseName,
- -- Exp
- varEName, conEName, litEName, appEName, infixEName,
- infixAppName, sectionLName, sectionRName, lamEName, lamCaseEName,
- tupEName, unboxedTupEName,
- condEName, multiIfEName, letEName, caseEName, doEName, compEName,
- fromEName, fromThenEName, fromToEName, fromThenToEName,
- listEName, sigEName, recConEName, recUpdEName, staticEName,
- -- FieldExp
- fieldExpName,
- -- Body
- guardedBName, normalBName,
- -- Guard
- normalGEName, patGEName,
- -- Stmt
- bindSName, letSName, noBindSName, parSName,
- -- Dec
- funDName, valDName, dataDName, newtypeDName, tySynDName,
- classDName, instanceDName, standaloneDerivDName, sigDName, forImpDName,
- pragInlDName, pragSpecDName, pragSpecInlDName, pragSpecInstDName,
- pragRuleDName, pragAnnDName, defaultSigDName,
- familyNoKindDName, familyKindDName, dataInstDName, newtypeInstDName,
- tySynInstDName, closedTypeFamilyKindDName, closedTypeFamilyNoKindDName,
- infixLDName, infixRDName, infixNDName,
- roleAnnotDName,
- -- Cxt
- cxtName,
- -- Strict
- isStrictName, notStrictName, unpackedName,
- -- Con
- normalCName, recCName, infixCName, forallCName,
- -- StrictType
- strictTypeName,
- -- VarStrictType
- varStrictTypeName,
- -- Type
- forallTName, varTName, conTName, appTName, equalityTName,
- tupleTName, unboxedTupleTName, arrowTName, listTName, sigTName, litTName,
- promotedTName, promotedTupleTName, promotedNilTName, promotedConsTName,
- -- TyLit
- numTyLitName, strTyLitName,
- -- TyVarBndr
- plainTVName, kindedTVName,
- -- Role
- nominalRName, representationalRName, phantomRName, inferRName,
- -- Kind
- varKName, conKName, tupleKName, arrowKName, listKName, appKName,
- starKName, constraintKName,
- -- Callconv
- cCallName, stdCallName, cApiCallName, primCallName, javaScriptCallName,
- -- Safety
- unsafeName,
- safeName,
- interruptibleName,
- -- Inline
- noInlineDataConName, inlineDataConName, inlinableDataConName,
- -- RuleMatch
- conLikeDataConName, funLikeDataConName,
- -- Phases
- allPhasesDataConName, fromPhaseDataConName, beforePhaseDataConName,
- -- TExp
- tExpDataConName,
- -- RuleBndr
- ruleVarName, typedRuleVarName,
- -- FunDep
- funDepName,
- -- FamFlavour
- typeFamName, dataFamName,
- -- TySynEqn
- tySynEqnName,
- -- AnnTarget
- valueAnnotationName, typeAnnotationName, moduleAnnotationName,
-
- -- And the tycons
- qTyConName, nameTyConName, patTyConName, fieldPatTyConName, matchQTyConName,
- clauseQTyConName, expQTyConName, fieldExpTyConName, predTyConName,
- stmtQTyConName, decQTyConName, conQTyConName, strictTypeQTyConName,
- varStrictTypeQTyConName, typeQTyConName, expTyConName, decTyConName,
- typeTyConName, tyVarBndrTyConName, matchTyConName, clauseTyConName,
- patQTyConName, fieldPatQTyConName, fieldExpQTyConName, funDepTyConName,
- predQTyConName, decsQTyConName, ruleBndrQTyConName, tySynEqnQTyConName,
- roleTyConName, tExpTyConName,
-
- -- Quasiquoting
- quoteDecName, quoteTypeName, quoteExpName, quotePatName]
-
-thSyn, thLib, qqLib :: Module
-thSyn = mkTHModule (fsLit "Language.Haskell.TH.Syntax")
-thLib = mkTHModule (fsLit "Language.Haskell.TH.Lib")
-qqLib = mkTHModule (fsLit "Language.Haskell.TH.Quote")
-
-mkTHModule :: FastString -> Module
-mkTHModule m = mkModule thPackageKey (mkModuleNameFS m)
-
-libFun, libTc, thFun, thTc, thCon, qqFun :: FastString -> Unique -> Name
-libFun = mk_known_key_name OccName.varName thLib
-libTc = mk_known_key_name OccName.tcName thLib
-thFun = mk_known_key_name OccName.varName thSyn
-thTc = mk_known_key_name OccName.tcName thSyn
-thCon = mk_known_key_name OccName.dataName thSyn
-qqFun = mk_known_key_name OccName.varName qqLib
-
--------------------- TH.Syntax -----------------------
-qTyConName, nameTyConName, fieldExpTyConName, patTyConName,
- fieldPatTyConName, expTyConName, decTyConName, typeTyConName,
- tyVarBndrTyConName, matchTyConName, clauseTyConName, funDepTyConName,
- predTyConName, tExpTyConName :: Name
-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
-tyVarBndrTyConName= thTc (fsLit "TyVarBndr") tyVarBndrTyConKey
-matchTyConName = thTc (fsLit "Match") matchTyConKey
-clauseTyConName = thTc (fsLit "Clause") clauseTyConKey
-funDepTyConName = thTc (fsLit "FunDep") funDepTyConKey
-predTyConName = thTc (fsLit "Pred") predTyConKey
-tExpTyConName = thTc (fsLit "TExp") tExpTyConKey
-
-returnQName, bindQName, sequenceQName, newNameName, liftName,
- mkNameName, mkNameG_vName, mkNameG_dName, mkNameG_tcName,
- mkNameLName, liftStringName, unTypeName, unTypeQName,
- unsafeTExpCoerceName :: Name
-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
-liftStringName = thFun (fsLit "liftString") liftStringIdKey
-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
-mkNameLName = thFun (fsLit "mkNameL") mkNameLIdKey
-unTypeName = thFun (fsLit "unType") unTypeIdKey
-unTypeQName = thFun (fsLit "unTypeQ") unTypeQIdKey
-unsafeTExpCoerceName = thFun (fsLit "unsafeTExpCoerce") unsafeTExpCoerceIdKey
-
-
--------------------- TH.Lib -----------------------
--- data Lit = ...
-charLName, stringLName, integerLName, intPrimLName, wordPrimLName,
- floatPrimLName, doublePrimLName, rationalLName :: Name
-charLName = libFun (fsLit "charL") charLIdKey
-stringLName = libFun (fsLit "stringL") stringLIdKey
-integerLName = libFun (fsLit "integerL") integerLIdKey
-intPrimLName = libFun (fsLit "intPrimL") intPrimLIdKey
-wordPrimLName = libFun (fsLit "wordPrimL") wordPrimLIdKey
-floatPrimLName = libFun (fsLit "floatPrimL") floatPrimLIdKey
-doublePrimLName = libFun (fsLit "doublePrimL") doublePrimLIdKey
-rationalLName = libFun (fsLit "rationalL") rationalLIdKey
-
--- data Pat = ...
-litPName, varPName, tupPName, unboxedTupPName, conPName, infixPName, tildePName, bangPName,
- asPName, wildPName, recPName, listPName, sigPName, viewPName :: Name
-litPName = libFun (fsLit "litP") litPIdKey
-varPName = libFun (fsLit "varP") varPIdKey
-tupPName = libFun (fsLit "tupP") tupPIdKey
-unboxedTupPName = libFun (fsLit "unboxedTupP") unboxedTupPIdKey
-conPName = libFun (fsLit "conP") conPIdKey
-infixPName = libFun (fsLit "infixP") infixPIdKey
-tildePName = libFun (fsLit "tildeP") tildePIdKey
-bangPName = libFun (fsLit "bangP") bangPIdKey
-asPName = libFun (fsLit "asP") asPIdKey
-wildPName = libFun (fsLit "wildP") wildPIdKey
-recPName = libFun (fsLit "recP") recPIdKey
-listPName = libFun (fsLit "listP") listPIdKey
-sigPName = libFun (fsLit "sigP") sigPIdKey
-viewPName = libFun (fsLit "viewP") viewPIdKey
-
--- type FieldPat = ...
-fieldPatName :: Name
-fieldPatName = libFun (fsLit "fieldPat") fieldPatIdKey
-
--- data Match = ...
-matchName :: Name
-matchName = libFun (fsLit "match") matchIdKey
-
--- data Clause = ...
-clauseName :: Name
-clauseName = libFun (fsLit "clause") clauseIdKey
-
--- data Exp = ...
-varEName, conEName, litEName, appEName, infixEName, infixAppName,
- sectionLName, sectionRName, lamEName, lamCaseEName, tupEName,
- unboxedTupEName, condEName, multiIfEName, letEName, caseEName,
- doEName, compEName, staticEName :: Name
-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
-lamCaseEName = libFun (fsLit "lamCaseE") lamCaseEIdKey
-tupEName = libFun (fsLit "tupE") tupEIdKey
-unboxedTupEName = libFun (fsLit "unboxedTupE") unboxedTupEIdKey
-condEName = libFun (fsLit "condE") condEIdKey
-multiIfEName = libFun (fsLit "multiIfE") multiIfEIdKey
-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, fromThenEName, fromToEName, fromThenToEName :: Name
-fromEName = libFun (fsLit "fromE") fromEIdKey
-fromThenEName = libFun (fsLit "fromThenE") fromThenEIdKey
-fromToEName = libFun (fsLit "fromToE") fromToEIdKey
-fromThenToEName = libFun (fsLit "fromThenToE") fromThenToEIdKey
--- end ArithSeq
-listEName, sigEName, recConEName, recUpdEName :: Name
-listEName = libFun (fsLit "listE") listEIdKey
-sigEName = libFun (fsLit "sigE") sigEIdKey
-recConEName = libFun (fsLit "recConE") recConEIdKey
-recUpdEName = libFun (fsLit "recUpdE") recUpdEIdKey
-staticEName = libFun (fsLit "staticE") staticEIdKey
-
--- type FieldExp = ...
-fieldExpName :: Name
-fieldExpName = libFun (fsLit "fieldExp") fieldExpIdKey
-
--- data Body = ...
-guardedBName, normalBName :: Name
-guardedBName = libFun (fsLit "guardedB") guardedBIdKey
-normalBName = libFun (fsLit "normalB") normalBIdKey
-
--- data Guard = ...
-normalGEName, patGEName :: Name
-normalGEName = libFun (fsLit "normalGE") normalGEIdKey
-patGEName = libFun (fsLit "patGE") patGEIdKey
-
--- data Stmt = ...
-bindSName, letSName, noBindSName, parSName :: Name
-bindSName = libFun (fsLit "bindS") bindSIdKey
-letSName = libFun (fsLit "letS") letSIdKey
-noBindSName = libFun (fsLit "noBindS") noBindSIdKey
-parSName = libFun (fsLit "parS") parSIdKey
-
--- data Dec = ...
-funDName, valDName, dataDName, newtypeDName, tySynDName, classDName,
- instanceDName, sigDName, forImpDName, pragInlDName, pragSpecDName,
- pragSpecInlDName, pragSpecInstDName, pragRuleDName, pragAnnDName,
- familyNoKindDName, standaloneDerivDName, defaultSigDName,
- familyKindDName, dataInstDName, newtypeInstDName, tySynInstDName,
- closedTypeFamilyKindDName, closedTypeFamilyNoKindDName,
- infixLDName, infixRDName, infixNDName, roleAnnotDName :: Name
-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
-standaloneDerivDName
- = libFun (fsLit "standaloneDerivD") standaloneDerivDIdKey
-sigDName = libFun (fsLit "sigD") sigDIdKey
-defaultSigDName = libFun (fsLit "defaultSigD") defaultSigDIdKey
-forImpDName = libFun (fsLit "forImpD") forImpDIdKey
-pragInlDName = libFun (fsLit "pragInlD") pragInlDIdKey
-pragSpecDName = libFun (fsLit "pragSpecD") pragSpecDIdKey
-pragSpecInlDName = libFun (fsLit "pragSpecInlD") pragSpecInlDIdKey
-pragSpecInstDName = libFun (fsLit "pragSpecInstD") pragSpecInstDIdKey
-pragRuleDName = libFun (fsLit "pragRuleD") pragRuleDIdKey
-pragAnnDName = libFun (fsLit "pragAnnD") pragAnnDIdKey
-familyNoKindDName = libFun (fsLit "familyNoKindD") familyNoKindDIdKey
-familyKindDName = libFun (fsLit "familyKindD") familyKindDIdKey
-dataInstDName = libFun (fsLit "dataInstD") dataInstDIdKey
-newtypeInstDName = libFun (fsLit "newtypeInstD") newtypeInstDIdKey
-tySynInstDName = libFun (fsLit "tySynInstD") tySynInstDIdKey
-closedTypeFamilyKindDName
- = libFun (fsLit "closedTypeFamilyKindD") closedTypeFamilyKindDIdKey
-closedTypeFamilyNoKindDName
- = libFun (fsLit "closedTypeFamilyNoKindD") closedTypeFamilyNoKindDIdKey
-infixLDName = libFun (fsLit "infixLD") infixLDIdKey
-infixRDName = libFun (fsLit "infixRD") infixRDIdKey
-infixNDName = libFun (fsLit "infixND") infixNDIdKey
-roleAnnotDName = libFun (fsLit "roleAnnotD") roleAnnotDIdKey
-
--- type Ctxt = ...
-cxtName :: Name
-cxtName = libFun (fsLit "cxt") cxtIdKey
-
--- data Strict = ...
-isStrictName, notStrictName, unpackedName :: Name
-isStrictName = libFun (fsLit "isStrict") isStrictKey
-notStrictName = libFun (fsLit "notStrict") notStrictKey
-unpackedName = libFun (fsLit "unpacked") unpackedKey
-
--- data Con = ...
-normalCName, recCName, infixCName, forallCName :: Name
-normalCName = libFun (fsLit "normalC") normalCIdKey
-recCName = libFun (fsLit "recC") recCIdKey
-infixCName = libFun (fsLit "infixC") infixCIdKey
-forallCName = libFun (fsLit "forallC") forallCIdKey
-
--- type StrictType = ...
-strictTypeName :: Name
-strictTypeName = libFun (fsLit "strictType") strictTKey
-
--- type VarStrictType = ...
-varStrictTypeName :: Name
-varStrictTypeName = libFun (fsLit "varStrictType") varStrictTKey
-
--- data Type = ...
-forallTName, varTName, conTName, tupleTName, unboxedTupleTName, arrowTName,
- listTName, appTName, sigTName, equalityTName, litTName,
- promotedTName, promotedTupleTName,
- promotedNilTName, promotedConsTName :: Name
-forallTName = libFun (fsLit "forallT") forallTIdKey
-varTName = libFun (fsLit "varT") varTIdKey
-conTName = libFun (fsLit "conT") conTIdKey
-tupleTName = libFun (fsLit "tupleT") tupleTIdKey
-unboxedTupleTName = libFun (fsLit "unboxedTupleT") unboxedTupleTIdKey
-arrowTName = libFun (fsLit "arrowT") arrowTIdKey
-listTName = libFun (fsLit "listT") listTIdKey
-appTName = libFun (fsLit "appT") appTIdKey
-sigTName = libFun (fsLit "sigT") sigTIdKey
-equalityTName = libFun (fsLit "equalityT") equalityTIdKey
-litTName = libFun (fsLit "litT") litTIdKey
-promotedTName = libFun (fsLit "promotedT") promotedTIdKey
-promotedTupleTName = libFun (fsLit "promotedTupleT") promotedTupleTIdKey
-promotedNilTName = libFun (fsLit "promotedNilT") promotedNilTIdKey
-promotedConsTName = libFun (fsLit "promotedConsT") promotedConsTIdKey
-
--- data TyLit = ...
-numTyLitName, strTyLitName :: Name
-numTyLitName = libFun (fsLit "numTyLit") numTyLitIdKey
-strTyLitName = libFun (fsLit "strTyLit") strTyLitIdKey
-
--- data TyVarBndr = ...
-plainTVName, kindedTVName :: Name
-plainTVName = libFun (fsLit "plainTV") plainTVIdKey
-kindedTVName = libFun (fsLit "kindedTV") kindedTVIdKey
-
--- data Role = ...
-nominalRName, representationalRName, phantomRName, inferRName :: Name
-nominalRName = libFun (fsLit "nominalR") nominalRIdKey
-representationalRName = libFun (fsLit "representationalR") representationalRIdKey
-phantomRName = libFun (fsLit "phantomR") phantomRIdKey
-inferRName = libFun (fsLit "inferR") inferRIdKey
-
--- data Kind = ...
-varKName, conKName, tupleKName, arrowKName, listKName, appKName,
- starKName, constraintKName :: Name
-varKName = libFun (fsLit "varK") varKIdKey
-conKName = libFun (fsLit "conK") conKIdKey
-tupleKName = libFun (fsLit "tupleK") tupleKIdKey
-arrowKName = libFun (fsLit "arrowK") arrowKIdKey
-listKName = libFun (fsLit "listK") listKIdKey
-appKName = libFun (fsLit "appK") appKIdKey
-starKName = libFun (fsLit "starK") starKIdKey
-constraintKName = libFun (fsLit "constraintK") constraintKIdKey
-
--- data Callconv = ...
-cCallName, stdCallName, cApiCallName, primCallName, javaScriptCallName :: Name
-cCallName = libFun (fsLit "cCall") cCallIdKey
-stdCallName = libFun (fsLit "stdCall") stdCallIdKey
-cApiCallName = libFun (fsLit "cApi") cApiCallIdKey
-primCallName = libFun (fsLit "prim") primCallIdKey
-javaScriptCallName = libFun (fsLit "javaScript") javaScriptCallIdKey
-
--- data Safety = ...
-unsafeName, safeName, interruptibleName :: Name
-unsafeName = libFun (fsLit "unsafe") unsafeIdKey
-safeName = libFun (fsLit "safe") safeIdKey
-interruptibleName = libFun (fsLit "interruptible") interruptibleIdKey
-
--- data Inline = ...
-noInlineDataConName, inlineDataConName, inlinableDataConName :: Name
-noInlineDataConName = thCon (fsLit "NoInline") noInlineDataConKey
-inlineDataConName = thCon (fsLit "Inline") inlineDataConKey
-inlinableDataConName = thCon (fsLit "Inlinable") inlinableDataConKey
-
--- data RuleMatch = ...
-conLikeDataConName, funLikeDataConName :: Name
-conLikeDataConName = thCon (fsLit "ConLike") conLikeDataConKey
-funLikeDataConName = thCon (fsLit "FunLike") funLikeDataConKey
-
--- data Phases = ...
-allPhasesDataConName, fromPhaseDataConName, beforePhaseDataConName :: Name
-allPhasesDataConName = thCon (fsLit "AllPhases") allPhasesDataConKey
-fromPhaseDataConName = thCon (fsLit "FromPhase") fromPhaseDataConKey
-beforePhaseDataConName = thCon (fsLit "BeforePhase") beforePhaseDataConKey
-
--- newtype TExp a = ...
-tExpDataConName :: Name
-tExpDataConName = thCon (fsLit "TExp") tExpDataConKey
-
--- data RuleBndr = ...
-ruleVarName, typedRuleVarName :: Name
-ruleVarName = libFun (fsLit ("ruleVar")) ruleVarIdKey
-typedRuleVarName = libFun (fsLit ("typedRuleVar")) typedRuleVarIdKey
-
--- data FunDep = ...
-funDepName :: Name
-funDepName = libFun (fsLit "funDep") funDepIdKey
-
--- data FamFlavour = ...
-typeFamName, dataFamName :: Name
-typeFamName = libFun (fsLit "typeFam") typeFamIdKey
-dataFamName = libFun (fsLit "dataFam") dataFamIdKey
-
--- data TySynEqn = ...
-tySynEqnName :: Name
-tySynEqnName = libFun (fsLit "tySynEqn") tySynEqnIdKey
-
--- data AnnTarget = ...
-valueAnnotationName, typeAnnotationName, moduleAnnotationName :: Name
-valueAnnotationName = libFun (fsLit "valueAnnotation") valueAnnotationIdKey
-typeAnnotationName = libFun (fsLit "typeAnnotation") typeAnnotationIdKey
-moduleAnnotationName = libFun (fsLit "moduleAnnotation") moduleAnnotationIdKey
-
-matchQTyConName, clauseQTyConName, expQTyConName, stmtQTyConName,
- decQTyConName, conQTyConName, strictTypeQTyConName,
- varStrictTypeQTyConName, typeQTyConName, fieldExpQTyConName,
- patQTyConName, fieldPatQTyConName, predQTyConName, decsQTyConName,
- ruleBndrQTyConName, tySynEqnQTyConName, roleTyConName :: Name
-matchQTyConName = libTc (fsLit "MatchQ") matchQTyConKey
-clauseQTyConName = libTc (fsLit "ClauseQ") clauseQTyConKey
-expQTyConName = libTc (fsLit "ExpQ") expQTyConKey
-stmtQTyConName = libTc (fsLit "StmtQ") stmtQTyConKey
-decQTyConName = libTc (fsLit "DecQ") decQTyConKey
-decsQTyConName = libTc (fsLit "DecsQ") decsQTyConKey -- Q [Dec]
-conQTyConName = libTc (fsLit "ConQ") conQTyConKey
-strictTypeQTyConName = libTc (fsLit "StrictTypeQ") strictTypeQTyConKey
-varStrictTypeQTyConName = libTc (fsLit "VarStrictTypeQ") varStrictTypeQTyConKey
-typeQTyConName = libTc (fsLit "TypeQ") typeQTyConKey
-fieldExpQTyConName = libTc (fsLit "FieldExpQ") fieldExpQTyConKey
-patQTyConName = libTc (fsLit "PatQ") patQTyConKey
-fieldPatQTyConName = libTc (fsLit "FieldPatQ") fieldPatQTyConKey
-predQTyConName = libTc (fsLit "PredQ") predQTyConKey
-ruleBndrQTyConName = libTc (fsLit "RuleBndrQ") ruleBndrQTyConKey
-tySynEqnQTyConName = libTc (fsLit "TySynEqnQ") tySynEqnQTyConKey
-roleTyConName = libTc (fsLit "Role") roleTyConKey
-
--- quasiquoting
-quoteExpName, quotePatName, quoteDecName, quoteTypeName :: Name
-quoteExpName = qqFun (fsLit "quoteExp") quoteExpKey
-quotePatName = qqFun (fsLit "quotePat") quotePatKey
-quoteDecName = qqFun (fsLit "quoteDec") quoteDecKey
-quoteTypeName = qqFun (fsLit "quoteType") quoteTypeKey
-
--- TyConUniques available: 200-299
--- Check in PrelNames if you want to change this
-
-expTyConKey, matchTyConKey, clauseTyConKey, qTyConKey, expQTyConKey,
- decQTyConKey, patTyConKey, matchQTyConKey, clauseQTyConKey,
- stmtQTyConKey, conQTyConKey, typeQTyConKey, typeTyConKey, tyVarBndrTyConKey,
- decTyConKey, varStrictTypeQTyConKey, strictTypeQTyConKey,
- fieldExpTyConKey, fieldPatTyConKey, nameTyConKey, patQTyConKey,
- fieldPatQTyConKey, fieldExpQTyConKey, funDepTyConKey, predTyConKey,
- predQTyConKey, decsQTyConKey, ruleBndrQTyConKey, tySynEqnQTyConKey,
- roleTyConKey, tExpTyConKey :: Unique
-expTyConKey = mkPreludeTyConUnique 200
-matchTyConKey = mkPreludeTyConUnique 201
-clauseTyConKey = mkPreludeTyConUnique 202
-qTyConKey = mkPreludeTyConUnique 203
-expQTyConKey = mkPreludeTyConUnique 204
-decQTyConKey = mkPreludeTyConUnique 205
-patTyConKey = mkPreludeTyConUnique 206
-matchQTyConKey = mkPreludeTyConUnique 207
-clauseQTyConKey = mkPreludeTyConUnique 208
-stmtQTyConKey = mkPreludeTyConUnique 209
-conQTyConKey = mkPreludeTyConUnique 210
-typeQTyConKey = mkPreludeTyConUnique 211
-typeTyConKey = mkPreludeTyConUnique 212
-decTyConKey = mkPreludeTyConUnique 213
-varStrictTypeQTyConKey = mkPreludeTyConUnique 214
-strictTypeQTyConKey = mkPreludeTyConUnique 215
-fieldExpTyConKey = mkPreludeTyConUnique 216
-fieldPatTyConKey = mkPreludeTyConUnique 217
-nameTyConKey = mkPreludeTyConUnique 218
-patQTyConKey = mkPreludeTyConUnique 219
-fieldPatQTyConKey = mkPreludeTyConUnique 220
-fieldExpQTyConKey = mkPreludeTyConUnique 221
-funDepTyConKey = mkPreludeTyConUnique 222
-predTyConKey = mkPreludeTyConUnique 223
-predQTyConKey = mkPreludeTyConUnique 224
-tyVarBndrTyConKey = mkPreludeTyConUnique 225
-decsQTyConKey = mkPreludeTyConUnique 226
-ruleBndrQTyConKey = mkPreludeTyConUnique 227
-tySynEqnQTyConKey = mkPreludeTyConUnique 228
-roleTyConKey = mkPreludeTyConUnique 229
-tExpTyConKey = mkPreludeTyConUnique 230
-
--- IdUniques available: 200-499
--- If you want to change this, make sure you check in PrelNames
-
-returnQIdKey, bindQIdKey, sequenceQIdKey, liftIdKey, newNameIdKey,
- mkNameIdKey, mkNameG_vIdKey, mkNameG_dIdKey, mkNameG_tcIdKey,
- mkNameLIdKey, unTypeIdKey, unTypeQIdKey, unsafeTExpCoerceIdKey :: Unique
-returnQIdKey = mkPreludeMiscIdUnique 200
-bindQIdKey = mkPreludeMiscIdUnique 201
-sequenceQIdKey = mkPreludeMiscIdUnique 202
-liftIdKey = mkPreludeMiscIdUnique 203
-newNameIdKey = mkPreludeMiscIdUnique 204
-mkNameIdKey = mkPreludeMiscIdUnique 205
-mkNameG_vIdKey = mkPreludeMiscIdUnique 206
-mkNameG_dIdKey = mkPreludeMiscIdUnique 207
-mkNameG_tcIdKey = mkPreludeMiscIdUnique 208
-mkNameLIdKey = mkPreludeMiscIdUnique 209
-unTypeIdKey = mkPreludeMiscIdUnique 210
-unTypeQIdKey = mkPreludeMiscIdUnique 211
-unsafeTExpCoerceIdKey = mkPreludeMiscIdUnique 212
-
-
--- data Lit = ...
-charLIdKey, stringLIdKey, integerLIdKey, intPrimLIdKey, wordPrimLIdKey,
- floatPrimLIdKey, doublePrimLIdKey, rationalLIdKey :: Unique
-charLIdKey = mkPreludeMiscIdUnique 220
-stringLIdKey = mkPreludeMiscIdUnique 221
-integerLIdKey = mkPreludeMiscIdUnique 222
-intPrimLIdKey = mkPreludeMiscIdUnique 223
-wordPrimLIdKey = mkPreludeMiscIdUnique 224
-floatPrimLIdKey = mkPreludeMiscIdUnique 225
-doublePrimLIdKey = mkPreludeMiscIdUnique 226
-rationalLIdKey = mkPreludeMiscIdUnique 227
-
-liftStringIdKey :: Unique
-liftStringIdKey = mkPreludeMiscIdUnique 228
-
--- data Pat = ...
-litPIdKey, varPIdKey, tupPIdKey, unboxedTupPIdKey, conPIdKey, infixPIdKey, tildePIdKey, bangPIdKey,
- asPIdKey, wildPIdKey, recPIdKey, listPIdKey, sigPIdKey, viewPIdKey :: Unique
-litPIdKey = mkPreludeMiscIdUnique 240
-varPIdKey = mkPreludeMiscIdUnique 241
-tupPIdKey = mkPreludeMiscIdUnique 242
-unboxedTupPIdKey = mkPreludeMiscIdUnique 243
-conPIdKey = mkPreludeMiscIdUnique 244
-infixPIdKey = mkPreludeMiscIdUnique 245
-tildePIdKey = mkPreludeMiscIdUnique 246
-bangPIdKey = mkPreludeMiscIdUnique 247
-asPIdKey = mkPreludeMiscIdUnique 248
-wildPIdKey = mkPreludeMiscIdUnique 249
-recPIdKey = mkPreludeMiscIdUnique 250
-listPIdKey = mkPreludeMiscIdUnique 251
-sigPIdKey = mkPreludeMiscIdUnique 252
-viewPIdKey = mkPreludeMiscIdUnique 253
-
--- type FieldPat = ...
-fieldPatIdKey :: Unique
-fieldPatIdKey = mkPreludeMiscIdUnique 260
-
--- data Match = ...
-matchIdKey :: Unique
-matchIdKey = mkPreludeMiscIdUnique 261
-
--- data Clause = ...
-clauseIdKey :: Unique
-clauseIdKey = mkPreludeMiscIdUnique 262
-
-
--- data Exp = ...
-varEIdKey, conEIdKey, litEIdKey, appEIdKey, infixEIdKey, infixAppIdKey,
- sectionLIdKey, sectionRIdKey, lamEIdKey, lamCaseEIdKey, tupEIdKey,
- unboxedTupEIdKey, condEIdKey, multiIfEIdKey,
- letEIdKey, caseEIdKey, doEIdKey, compEIdKey,
- fromEIdKey, fromThenEIdKey, fromToEIdKey, fromThenToEIdKey,
- listEIdKey, sigEIdKey, recConEIdKey, recUpdEIdKey, staticEIdKey :: Unique
-varEIdKey = mkPreludeMiscIdUnique 270
-conEIdKey = mkPreludeMiscIdUnique 271
-litEIdKey = mkPreludeMiscIdUnique 272
-appEIdKey = mkPreludeMiscIdUnique 273
-infixEIdKey = mkPreludeMiscIdUnique 274
-infixAppIdKey = mkPreludeMiscIdUnique 275
-sectionLIdKey = mkPreludeMiscIdUnique 276
-sectionRIdKey = mkPreludeMiscIdUnique 277
-lamEIdKey = mkPreludeMiscIdUnique 278
-lamCaseEIdKey = mkPreludeMiscIdUnique 279
-tupEIdKey = mkPreludeMiscIdUnique 280
-unboxedTupEIdKey = mkPreludeMiscIdUnique 281
-condEIdKey = mkPreludeMiscIdUnique 282
-multiIfEIdKey = mkPreludeMiscIdUnique 283
-letEIdKey = mkPreludeMiscIdUnique 284
-caseEIdKey = mkPreludeMiscIdUnique 285
-doEIdKey = mkPreludeMiscIdUnique 286
-compEIdKey = mkPreludeMiscIdUnique 287
-fromEIdKey = mkPreludeMiscIdUnique 288
-fromThenEIdKey = mkPreludeMiscIdUnique 289
-fromToEIdKey = mkPreludeMiscIdUnique 290
-fromThenToEIdKey = mkPreludeMiscIdUnique 291
-listEIdKey = mkPreludeMiscIdUnique 292
-sigEIdKey = mkPreludeMiscIdUnique 293
-recConEIdKey = mkPreludeMiscIdUnique 294
-recUpdEIdKey = mkPreludeMiscIdUnique 295
-staticEIdKey = mkPreludeMiscIdUnique 296
-
--- type FieldExp = ...
-fieldExpIdKey :: Unique
-fieldExpIdKey = mkPreludeMiscIdUnique 310
-
--- data Body = ...
-guardedBIdKey, normalBIdKey :: Unique
-guardedBIdKey = mkPreludeMiscIdUnique 311
-normalBIdKey = mkPreludeMiscIdUnique 312
-
--- data Guard = ...
-normalGEIdKey, patGEIdKey :: Unique
-normalGEIdKey = mkPreludeMiscIdUnique 313
-patGEIdKey = mkPreludeMiscIdUnique 314
-
--- data Stmt = ...
-bindSIdKey, letSIdKey, noBindSIdKey, parSIdKey :: Unique
-bindSIdKey = mkPreludeMiscIdUnique 320
-letSIdKey = mkPreludeMiscIdUnique 321
-noBindSIdKey = mkPreludeMiscIdUnique 322
-parSIdKey = mkPreludeMiscIdUnique 323
-
--- data Dec = ...
-funDIdKey, valDIdKey, dataDIdKey, newtypeDIdKey, tySynDIdKey,
- classDIdKey, instanceDIdKey, sigDIdKey, forImpDIdKey, pragInlDIdKey,
- pragSpecDIdKey, pragSpecInlDIdKey, pragSpecInstDIdKey, pragRuleDIdKey,
- pragAnnDIdKey, familyNoKindDIdKey, familyKindDIdKey, defaultSigDIdKey,
- dataInstDIdKey, newtypeInstDIdKey, tySynInstDIdKey, standaloneDerivDIdKey,
- closedTypeFamilyKindDIdKey, closedTypeFamilyNoKindDIdKey,
- infixLDIdKey, infixRDIdKey, infixNDIdKey, roleAnnotDIdKey :: Unique
-funDIdKey = mkPreludeMiscIdUnique 330
-valDIdKey = mkPreludeMiscIdUnique 331
-dataDIdKey = mkPreludeMiscIdUnique 332
-newtypeDIdKey = mkPreludeMiscIdUnique 333
-tySynDIdKey = mkPreludeMiscIdUnique 334
-classDIdKey = mkPreludeMiscIdUnique 335
-instanceDIdKey = mkPreludeMiscIdUnique 336
-sigDIdKey = mkPreludeMiscIdUnique 337
-forImpDIdKey = mkPreludeMiscIdUnique 338
-pragInlDIdKey = mkPreludeMiscIdUnique 339
-pragSpecDIdKey = mkPreludeMiscIdUnique 340
-pragSpecInlDIdKey = mkPreludeMiscIdUnique 341
-pragSpecInstDIdKey = mkPreludeMiscIdUnique 342
-pragRuleDIdKey = mkPreludeMiscIdUnique 343
-pragAnnDIdKey = mkPreludeMiscIdUnique 344
-familyNoKindDIdKey = mkPreludeMiscIdUnique 345
-familyKindDIdKey = mkPreludeMiscIdUnique 346
-dataInstDIdKey = mkPreludeMiscIdUnique 347
-newtypeInstDIdKey = mkPreludeMiscIdUnique 348
-tySynInstDIdKey = mkPreludeMiscIdUnique 349
-closedTypeFamilyKindDIdKey = mkPreludeMiscIdUnique 350
-closedTypeFamilyNoKindDIdKey = mkPreludeMiscIdUnique 351
-infixLDIdKey = mkPreludeMiscIdUnique 352
-infixRDIdKey = mkPreludeMiscIdUnique 353
-infixNDIdKey = mkPreludeMiscIdUnique 354
-roleAnnotDIdKey = mkPreludeMiscIdUnique 355
-standaloneDerivDIdKey = mkPreludeMiscIdUnique 356
-defaultSigDIdKey = mkPreludeMiscIdUnique 357
-
--- type Cxt = ...
-cxtIdKey :: Unique
-cxtIdKey = mkPreludeMiscIdUnique 360
-
--- data Strict = ...
-isStrictKey, notStrictKey, unpackedKey :: Unique
-isStrictKey = mkPreludeMiscIdUnique 363
-notStrictKey = mkPreludeMiscIdUnique 364
-unpackedKey = mkPreludeMiscIdUnique 365
-
--- data Con = ...
-normalCIdKey, recCIdKey, infixCIdKey, forallCIdKey :: Unique
-normalCIdKey = mkPreludeMiscIdUnique 370
-recCIdKey = mkPreludeMiscIdUnique 371
-infixCIdKey = mkPreludeMiscIdUnique 372
-forallCIdKey = mkPreludeMiscIdUnique 373
-
--- type StrictType = ...
-strictTKey :: Unique
-strictTKey = mkPreludeMiscIdUnique 374
-
--- type VarStrictType = ...
-varStrictTKey :: Unique
-varStrictTKey = mkPreludeMiscIdUnique 375
-
--- data Type = ...
-forallTIdKey, varTIdKey, conTIdKey, tupleTIdKey, unboxedTupleTIdKey, arrowTIdKey,
- listTIdKey, appTIdKey, sigTIdKey, equalityTIdKey, litTIdKey,
- promotedTIdKey, promotedTupleTIdKey,
- promotedNilTIdKey, promotedConsTIdKey :: Unique
-forallTIdKey = mkPreludeMiscIdUnique 380
-varTIdKey = mkPreludeMiscIdUnique 381
-conTIdKey = mkPreludeMiscIdUnique 382
-tupleTIdKey = mkPreludeMiscIdUnique 383
-unboxedTupleTIdKey = mkPreludeMiscIdUnique 384
-arrowTIdKey = mkPreludeMiscIdUnique 385
-listTIdKey = mkPreludeMiscIdUnique 386
-appTIdKey = mkPreludeMiscIdUnique 387
-sigTIdKey = mkPreludeMiscIdUnique 388
-equalityTIdKey = mkPreludeMiscIdUnique 389
-litTIdKey = mkPreludeMiscIdUnique 390
-promotedTIdKey = mkPreludeMiscIdUnique 391
-promotedTupleTIdKey = mkPreludeMiscIdUnique 392
-promotedNilTIdKey = mkPreludeMiscIdUnique 393
-promotedConsTIdKey = mkPreludeMiscIdUnique 394
-
--- data TyLit = ...
-numTyLitIdKey, strTyLitIdKey :: Unique
-numTyLitIdKey = mkPreludeMiscIdUnique 395
-strTyLitIdKey = mkPreludeMiscIdUnique 396
-
--- data TyVarBndr = ...
-plainTVIdKey, kindedTVIdKey :: Unique
-plainTVIdKey = mkPreludeMiscIdUnique 397
-kindedTVIdKey = mkPreludeMiscIdUnique 398
-
--- data Role = ...
-nominalRIdKey, representationalRIdKey, phantomRIdKey, inferRIdKey :: Unique
-nominalRIdKey = mkPreludeMiscIdUnique 400
-representationalRIdKey = mkPreludeMiscIdUnique 401
-phantomRIdKey = mkPreludeMiscIdUnique 402
-inferRIdKey = mkPreludeMiscIdUnique 403
-
--- data Kind = ...
-varKIdKey, conKIdKey, tupleKIdKey, arrowKIdKey, listKIdKey, appKIdKey,
- starKIdKey, constraintKIdKey :: Unique
-varKIdKey = mkPreludeMiscIdUnique 404
-conKIdKey = mkPreludeMiscIdUnique 405
-tupleKIdKey = mkPreludeMiscIdUnique 406
-arrowKIdKey = mkPreludeMiscIdUnique 407
-listKIdKey = mkPreludeMiscIdUnique 408
-appKIdKey = mkPreludeMiscIdUnique 409
-starKIdKey = mkPreludeMiscIdUnique 410
-constraintKIdKey = mkPreludeMiscIdUnique 411
-
--- data Callconv = ...
-cCallIdKey, stdCallIdKey, cApiCallIdKey, primCallIdKey,
- javaScriptCallIdKey :: Unique
-cCallIdKey = mkPreludeMiscIdUnique 420
-stdCallIdKey = mkPreludeMiscIdUnique 421
-cApiCallIdKey = mkPreludeMiscIdUnique 422
-primCallIdKey = mkPreludeMiscIdUnique 423
-javaScriptCallIdKey = mkPreludeMiscIdUnique 424
-
--- data Safety = ...
-unsafeIdKey, safeIdKey, interruptibleIdKey :: Unique
-unsafeIdKey = mkPreludeMiscIdUnique 430
-safeIdKey = mkPreludeMiscIdUnique 431
-interruptibleIdKey = mkPreludeMiscIdUnique 432
-
--- data Inline = ...
-noInlineDataConKey, inlineDataConKey, inlinableDataConKey :: Unique
-noInlineDataConKey = mkPreludeDataConUnique 40
-inlineDataConKey = mkPreludeDataConUnique 41
-inlinableDataConKey = mkPreludeDataConUnique 42
-
--- data RuleMatch = ...
-conLikeDataConKey, funLikeDataConKey :: Unique
-conLikeDataConKey = mkPreludeDataConUnique 43
-funLikeDataConKey = mkPreludeDataConUnique 44
-
--- data Phases = ...
-allPhasesDataConKey, fromPhaseDataConKey, beforePhaseDataConKey :: Unique
-allPhasesDataConKey = mkPreludeDataConUnique 45
-fromPhaseDataConKey = mkPreludeDataConUnique 46
-beforePhaseDataConKey = mkPreludeDataConUnique 47
-
--- newtype TExp a = ...
-tExpDataConKey :: Unique
-tExpDataConKey = mkPreludeDataConUnique 48
-
--- data FunDep = ...
-funDepIdKey :: Unique
-funDepIdKey = mkPreludeMiscIdUnique 440
-
--- data FamFlavour = ...
-typeFamIdKey, dataFamIdKey :: Unique
-typeFamIdKey = mkPreludeMiscIdUnique 450
-dataFamIdKey = mkPreludeMiscIdUnique 451
-
--- data TySynEqn = ...
-tySynEqnIdKey :: Unique
-tySynEqnIdKey = mkPreludeMiscIdUnique 460
-
--- quasiquoting
-quoteExpKey, quotePatKey, quoteDecKey, quoteTypeKey :: Unique
-quoteExpKey = mkPreludeMiscIdUnique 470
-quotePatKey = mkPreludeMiscIdUnique 471
-quoteDecKey = mkPreludeMiscIdUnique 472
-quoteTypeKey = mkPreludeMiscIdUnique 473
-
--- data RuleBndr = ...
-ruleVarIdKey, typedRuleVarIdKey :: Unique
-ruleVarIdKey = mkPreludeMiscIdUnique 480
-typedRuleVarIdKey = mkPreludeMiscIdUnique 481
-
--- data AnnTarget = ...
-valueAnnotationIdKey, typeAnnotationIdKey, moduleAnnotationIdKey :: Unique
-valueAnnotationIdKey = mkPreludeMiscIdUnique 490
-typeAnnotationIdKey = mkPreludeMiscIdUnique 491
-moduleAnnotationIdKey = mkPreludeMiscIdUnique 492
diff --git a/compiler/prelude/TysWiredIn.hs b/compiler/prelude/TysWiredIn.hs
index 34c1838997..6c2ffb7417 100644
--- a/compiler/prelude/TysWiredIn.hs
+++ b/compiler/prelude/TysWiredIn.hs
@@ -43,22 +43,21 @@ module TysWiredIn (
wordTyCon, wordDataCon, wordTyConName, wordTy,
-- * List
- listTyCon, listTyCon_RDR, listTyConName, listTyConKey,
- nilDataCon, nilDataConName, nilDataConKey,
- consDataCon_RDR, consDataCon, consDataConName,
-
+ listTyCon, nilDataCon, nilDataConName, consDataCon, consDataConName,
+ listTyCon_RDR, consDataCon_RDR, listTyConName,
mkListTy, mkPromotedListTy,
-- * Tuples
mkTupleTy, mkBoxedTupleTy,
- tupleTyCon, tupleDataCon, tupleTyConName,
+ tupleTyCon, tupleCon,
promotedTupleTyCon, promotedTupleDataCon,
- unitTyCon, unitDataCon, unitDataConId, unitTy, unitTyConKey,
- pairTyCon,
+ unitTyCon, unitDataCon, unitDataConId, pairTyCon,
unboxedUnitTyCon, unboxedUnitDataCon,
unboxedSingletonTyCon, unboxedSingletonDataCon,
unboxedPairTyCon, unboxedPairDataCon,
- cTupleTyConName, cTupleTyConNames, isCTupleTyConName,
+
+ -- * Unit
+ unitTy,
-- * Kinds
typeNatKindCon, typeNatKind, typeSymbolKindCon, typeSymbolKind,
@@ -85,7 +84,7 @@ import PrelNames
import TysPrim
-- others:
-import Constants ( mAX_TUPLE_SIZE, mAX_CTUPLE_SIZE )
+import Constants ( mAX_TUPLE_SIZE )
import Module ( Module )
import Type ( mkTyConApp )
import DataCon
@@ -96,14 +95,11 @@ import Class ( Class, mkClass )
import TypeRep
import RdrName
import Name
-import NameSet ( NameSet, mkNameSet, elemNameSet )
-import BasicTypes ( Arity, RecFlag(..), Boxity(..),
- TupleSort(..) )
+import BasicTypes ( TupleSort(..), tupleSortBoxity,
+ Arity, RecFlag(..), Boxity(..) )
import ForeignCall
-import Unique ( incrUnique,
- mkTupleTyConUnique, mkTupleDataConUnique,
- mkCTupleTyConUnique, mkPArrDataConUnique )
-import SrcLoc ( noSrcSpan )
+import Unique ( incrUnique, mkTupleTyConUnique,
+ mkTupleDataConUnique, mkPArrDataConUnique )
import Data.Array
import FastString
import Outputable
@@ -323,39 +319,14 @@ typeSymbolKind = TyConApp (promoteTyCon typeSymbolKindCon) []
Note [How tuples work] See also Note [Known-key names] in PrelNames
~~~~~~~~~~~~~~~~~~~~~~
* There are three families of tuple TyCons and corresponding
- DataCons, expressed by the type BasicTypes.TupleSort:
- data TupleSort = BoxedTuple | UnboxedTuple | ConstraintTuple
-
-* All three families are AlgTyCons, whose AlgTyConRhs is TupleTyCon
-
-* BoxedTuples
- - A wired-in type
- - Data type declarations in GHC.Tuple
- - The data constructors really have an info table
-
-* UnboxedTuples
- - A wired-in type
- - Have a pretend DataCon, defined in GHC.Prim,
- but no actual declaration and no info table
-
-* ConstraintTuples
- - Are known-key rather than wired-in. Reason: it's awkward to
- have all the superclass selectors wired-in.
- - Declared as classes in GHC.Classes, e.g.
- class (c1,c2) => (c1,c2)
- - Given constraints: the superclasses automatically become available
- - Wanted constraints: there is a built-in instance
- instance (c1,c2) => (c1,c2)
- - Currently just go up to 16; beyond that
- you have to use manual nesting
- - Their OccNames look like (%,,,%), so they can easily be
- distinguished from term tuples. But (following Haskell) we
- pretty-print saturated constraint tuples with round parens; see
- BasicTypes.tupleParens.
-
-* In quite a lot of places things are restrcted just to
- BoxedTuple/UnboxedTuple, and then we used BasicTypes.Boxity to distinguish
- E.g. tupleTyCon has a Boxity argument
+ DataCons, (boxed, unboxed, and constraint tuples), expressed by the
+ type BasicTypes.TupleSort.
+
+* DataCons (and workers etc) for BoxedTuple and ConstraintTuple have
+ - distinct Uniques
+ - the same OccName
+ Using the same OccName means (hack!) that a single copy of the
+ runtime library code (info tables etc) works for both.
* When looking up an OccName in the original-name cache
(IfaceEnv.lookupOrigNameCache), we spot the tuple OccName to make sure
@@ -369,164 +340,140 @@ isBuiltInOcc_maybe :: OccName -> Maybe Name
-- map to wired-in Names with BuiltInSyntax
isBuiltInOcc_maybe occ
= case occNameString occ of
- "[]" -> choose_ns listTyConName nilDataConName
+ "[]" -> choose_ns listTyCon nilDataCon
":" -> Just consDataConName
"[::]" -> Just parrTyConName
- "()" -> tup_name Boxed 0
- "(##)" -> tup_name Unboxed 0
- '(':',':rest -> parse_tuple Boxed 2 rest
- '(':'#':',':rest -> parse_tuple Unboxed 2 rest
+ "(##)" -> choose_ns unboxedUnitTyCon unboxedUnitDataCon
+ "()" -> choose_ns unitTyCon unitDataCon
+ '(':'#':',':rest -> parse_tuple UnboxedTuple 2 rest
+ '(':',':rest -> parse_tuple BoxedTuple 2 rest
_other -> Nothing
where
ns = occNameSpace occ
parse_tuple sort n rest
| (',' : rest2) <- rest = parse_tuple sort (n+1) rest2
- | tail_matches sort rest = tup_name sort n
+ | tail_matches sort rest = choose_ns (tupleTyCon sort n)
+ (tupleCon sort n)
| otherwise = Nothing
- tail_matches Boxed ")" = True
- tail_matches Unboxed "#)" = True
- tail_matches _ _ = False
-
- tup_name boxity arity
- = choose_ns (getName (tupleTyCon boxity arity))
- (getName (tupleDataCon boxity arity))
+ tail_matches BoxedTuple ")" = True
+ tail_matches UnboxedTuple "#)" = True
+ tail_matches _ _ = False
choose_ns tc dc
- | isTcClsNameSpace ns = Just tc
- | isDataConNameSpace ns = Just dc
- | otherwise = pprPanic "tup_name" (ppr occ)
+ | isTcClsNameSpace ns = Just (getName tc)
+ | isDataConNameSpace ns = Just (getName dc)
+ | otherwise = Just (getName (dataConWorkId dc))
-mkTupleOcc :: NameSpace -> Boxity -> Arity -> OccName
+mkTupleOcc :: NameSpace -> TupleSort -> Arity -> OccName
mkTupleOcc ns sort ar = mkOccName ns str
where
-- No need to cache these, the caching is done in mk_tuple
str = case sort of
- Unboxed -> '(' : '#' : commas ++ "#)"
- Boxed -> '(' : commas ++ ")"
-
- commas = take (ar-1) (repeat ',')
+ UnboxedTuple -> '(' : '#' : commas ++ "#)"
+ BoxedTuple -> '(' : commas ++ ")"
+ ConstraintTuple -> '(' : commas ++ ")"
-mkCTupleOcc :: NameSpace -> Arity -> OccName
-mkCTupleOcc ns ar = mkOccName ns str
- where
- str = "(%" ++ commas ++ "%)"
commas = take (ar-1) (repeat ',')
-cTupleTyConName :: Arity -> Name
-cTupleTyConName arity
- = mkExternalName (mkCTupleTyConUnique arity) gHC_CLASSES
- (mkCTupleOcc tcName arity) noSrcSpan
- -- The corresponding DataCon does not have a known-key name
-
-cTupleTyConNames :: [Name]
-cTupleTyConNames = map cTupleTyConName (0 : [2..mAX_CTUPLE_SIZE])
-
-cTupleTyConNameSet :: NameSet
-cTupleTyConNameSet = mkNameSet cTupleTyConNames
-
-isCTupleTyConName :: Name -> Bool
-isCTupleTyConName n
- = ASSERT2( isExternalName n, ppr n )
- nameModule n == gHC_CLASSES
- && n `elemNameSet` cTupleTyConNameSet
-
-tupleTyCon :: Boxity -> Arity -> TyCon
+ -- Cute hack: we reuse the standard tuple OccNames (and hence code)
+ -- for fact tuples, but give them different Uniques so they are not equal.
+ --
+ -- You might think that this will go wrong because isBuiltInOcc_maybe won't
+ -- be able to tell the difference between boxed tuples and constraint tuples. BUT:
+ -- 1. Constraint tuples never occur directly in user code, so it doesn't matter
+ -- that we can't detect them in Orig OccNames originating from the user
+ -- programs (or those built by setRdrNameSpace used on an Exact tuple Name)
+ -- 2. Interface files have a special representation for tuple *occurrences*
+ -- in IfaceTyCons, their workers (in IfaceSyn) and their DataCons (in case
+ -- alternatives). Thus we don't rely on the OccName to figure out what kind
+ -- of tuple an occurrence was trying to use in these situations.
+ -- 3. We *don't* represent tuple data type declarations specially, so those
+ -- are still turned into wired-in names via isBuiltInOcc_maybe. But that's OK
+ -- because we don't actually need to declare constraint tuples thanks to this hack.
+ --
+ -- So basically any OccName like (,,) flowing to isBuiltInOcc_maybe will always
+ -- refer to the standard boxed tuple. Cool :-)
+
+
+tupleTyCon :: TupleSort -> Arity -> TyCon
tupleTyCon sort i | i > mAX_TUPLE_SIZE = fst (mk_tuple sort i) -- Build one specially
-tupleTyCon Boxed i = fst (boxedTupleArr ! i)
-tupleTyCon Unboxed i = fst (unboxedTupleArr ! i)
-
-tupleTyConName :: TupleSort -> Arity -> Name
-tupleTyConName ConstraintTuple a = cTupleTyConName a
-tupleTyConName BoxedTuple a = tyConName (tupleTyCon Boxed a)
-tupleTyConName UnboxedTuple a = tyConName (tupleTyCon Unboxed a)
+tupleTyCon BoxedTuple i = fst (boxedTupleArr ! i)
+tupleTyCon UnboxedTuple i = fst (unboxedTupleArr ! i)
+tupleTyCon ConstraintTuple i = fst (factTupleArr ! i)
-promotedTupleTyCon :: Boxity -> Arity -> TyCon
-promotedTupleTyCon boxity i = promoteTyCon (tupleTyCon boxity i)
+promotedTupleTyCon :: TupleSort -> Arity -> TyCon
+promotedTupleTyCon sort i = promoteTyCon (tupleTyCon sort i)
-promotedTupleDataCon :: Boxity -> Arity -> TyCon
-promotedTupleDataCon boxity i = promoteDataCon (tupleDataCon boxity i)
+promotedTupleDataCon :: TupleSort -> Arity -> TyCon
+promotedTupleDataCon sort i = promoteDataCon (tupleCon sort i)
-tupleDataCon :: Boxity -> Arity -> DataCon
-tupleDataCon sort i | i > mAX_TUPLE_SIZE = snd (mk_tuple sort i) -- Build one specially
-tupleDataCon Boxed i = snd (boxedTupleArr ! i)
-tupleDataCon Unboxed i = snd (unboxedTupleArr ! i)
+tupleCon :: TupleSort -> Arity -> DataCon
+tupleCon sort i | i > mAX_TUPLE_SIZE = snd (mk_tuple sort i) -- Build one specially
+tupleCon BoxedTuple i = snd (boxedTupleArr ! i)
+tupleCon UnboxedTuple i = snd (unboxedTupleArr ! i)
+tupleCon ConstraintTuple i = snd (factTupleArr ! i)
-boxedTupleArr, unboxedTupleArr :: Array Int (TyCon,DataCon)
-boxedTupleArr = listArray (0,mAX_TUPLE_SIZE) [mk_tuple Boxed i | i <- [0..mAX_TUPLE_SIZE]]
-unboxedTupleArr = listArray (0,mAX_TUPLE_SIZE) [mk_tuple Unboxed i | i <- [0..mAX_TUPLE_SIZE]]
+boxedTupleArr, unboxedTupleArr, factTupleArr :: Array Int (TyCon,DataCon)
+boxedTupleArr = listArray (0,mAX_TUPLE_SIZE) [mk_tuple BoxedTuple i | i <- [0..mAX_TUPLE_SIZE]]
+unboxedTupleArr = listArray (0,mAX_TUPLE_SIZE) [mk_tuple UnboxedTuple i | i <- [0..mAX_TUPLE_SIZE]]
+factTupleArr = listArray (0,mAX_TUPLE_SIZE) [mk_tuple ConstraintTuple i | i <- [0..mAX_TUPLE_SIZE]]
-mk_tuple :: Boxity -> Int -> (TyCon,DataCon)
-mk_tuple boxity arity = (tycon, tuple_con)
+mk_tuple :: TupleSort -> Int -> (TyCon,DataCon)
+mk_tuple sort arity = (tycon, tuple_con)
where
- tycon = mkTupleTyCon tc_name tc_kind arity tyvars tuple_con
- tup_sort
- prom_tc NoParentTyCon
-
- tup_sort = case boxity of
- Boxed -> BoxedTuple
- Unboxed -> UnboxedTuple
-
- prom_tc = case boxity of
- Boxed -> Just (mkPromotedTyCon tycon (promoteKind tc_kind))
- Unboxed -> Nothing
-
- modu = case boxity of
- Boxed -> gHC_TUPLE
- Unboxed -> gHC_PRIM
-
- tc_name = mkWiredInName modu (mkTupleOcc tcName boxity arity) tc_uniq
+ tycon = mkTupleTyCon tc_name tc_kind arity tyvars tuple_con sort prom_tc
+ prom_tc = case sort of
+ BoxedTuple -> Just (mkPromotedTyCon tycon (promoteKind tc_kind))
+ UnboxedTuple -> Nothing
+ ConstraintTuple -> Nothing
+
+ modu = mkTupleModule sort
+ tc_name = mkWiredInName modu (mkTupleOcc tcName sort arity) tc_uniq
(ATyCon tycon) BuiltInSyntax
tc_kind = mkArrowKinds (map tyVarKind tyvars) res_kind
+ res_kind = case sort of
+ BoxedTuple -> liftedTypeKind
+ UnboxedTuple -> unliftedTypeKind
+ ConstraintTuple -> constraintKind
- res_kind = case boxity of
- Boxed -> liftedTypeKind
- Unboxed -> unliftedTypeKind
-
- tyvars = take arity $ case boxity of
- Boxed -> alphaTyVars
- Unboxed -> openAlphaTyVars
+ tyvars = take arity $ case sort of
+ BoxedTuple -> alphaTyVars
+ UnboxedTuple -> openAlphaTyVars
+ ConstraintTuple -> tyVarList constraintKind
tuple_con = pcDataCon dc_name tyvars tyvar_tys tycon
tyvar_tys = mkTyVarTys tyvars
- dc_name = mkWiredInName modu (mkTupleOcc dataName boxity arity) dc_uniq
+ dc_name = mkWiredInName modu (mkTupleOcc dataName sort arity) dc_uniq
(AConLike (RealDataCon tuple_con)) BuiltInSyntax
- tc_uniq = mkTupleTyConUnique boxity arity
- dc_uniq = mkTupleDataConUnique boxity arity
+ tc_uniq = mkTupleTyConUnique sort arity
+ dc_uniq = mkTupleDataConUnique sort arity
unitTyCon :: TyCon
-unitTyCon = tupleTyCon Boxed 0
-
-unitTyConKey :: Unique
-unitTyConKey = getUnique unitTyCon
-
+unitTyCon = tupleTyCon BoxedTuple 0
unitDataCon :: DataCon
unitDataCon = head (tyConDataCons unitTyCon)
-
unitDataConId :: Id
unitDataConId = dataConWorkId unitDataCon
pairTyCon :: TyCon
-pairTyCon = tupleTyCon Boxed 2
+pairTyCon = tupleTyCon BoxedTuple 2
unboxedUnitTyCon :: TyCon
-unboxedUnitTyCon = tupleTyCon Unboxed 0
-
+unboxedUnitTyCon = tupleTyCon UnboxedTuple 0
unboxedUnitDataCon :: DataCon
-unboxedUnitDataCon = tupleDataCon Unboxed 0
+unboxedUnitDataCon = tupleCon UnboxedTuple 0
unboxedSingletonTyCon :: TyCon
-unboxedSingletonTyCon = tupleTyCon Unboxed 1
-
+unboxedSingletonTyCon = tupleTyCon UnboxedTuple 1
unboxedSingletonDataCon :: DataCon
-unboxedSingletonDataCon = tupleDataCon Unboxed 1
+unboxedSingletonDataCon = tupleCon UnboxedTuple 1
unboxedPairTyCon :: TyCon
-unboxedPairTyCon = tupleTyCon Unboxed 2
-
+unboxedPairTyCon = tupleTyCon UnboxedTuple 2
unboxedPairDataCon :: DataCon
-unboxedPairDataCon = tupleDataCon Unboxed 2
+unboxedPairDataCon = tupleCon UnboxedTuple 2
{-
************************************************************************
@@ -807,17 +754,17 @@ done by enumeration\srcloc{lib/prelude/InTup?.hs}.
\end{itemize}
-}
-mkTupleTy :: Boxity -> [Type] -> Type
+mkTupleTy :: TupleSort -> [Type] -> Type
-- Special case for *boxed* 1-tuples, which are represented by the type itself
-mkTupleTy Boxed [ty] = ty
-mkTupleTy boxity tys = mkTyConApp (tupleTyCon boxity (length tys)) tys
+mkTupleTy sort [ty] | Boxed <- tupleSortBoxity sort = ty
+mkTupleTy sort tys = mkTyConApp (tupleTyCon sort (length tys)) tys
-- | Build the type of a small tuple that holds the specified type of thing
mkBoxedTupleTy :: [Type] -> Type
-mkBoxedTupleTy tys = mkTupleTy Boxed tys
+mkBoxedTupleTy tys = mkTupleTy BoxedTuple tys
unitTy :: Type
-unitTy = mkTupleTy Boxed []
+unitTy = mkTupleTy BoxedTuple []
{-
************************************************************************