Fix Trac #1814 (staging interaction in Template Haskell and GHCi), and add comments
[ghc-hetmet.git] / compiler / typecheck / TcEnv.lhs
index 4c87a12..a23795c 100644 (file)
@@ -47,7 +47,7 @@ module TcEnv(
 
        -- Template Haskell stuff
        checkWellStaged, spliceOK, bracketOK, tcMetaTy, thLevel, 
-       topIdLvl, 
+       topIdLvl, thTopLevelId,
 
        -- New Ids
        newLocalName, newDFunName, newFamInstTyConName,
@@ -604,6 +604,10 @@ tcMetaTy :: Name -> TcM Type
 tcMetaTy tc_name
   = tcLookupTyCon tc_name      `thenM` \ t ->
     returnM (mkTyConApp t [])
+
+thTopLevelId :: Id -> Bool
+-- See Note [What is a top-level Id?] in TcSplice
+thTopLevelId id = isGlobalId id || isExternalName (idName id)
 \end{code}