import HscTypes ( lookupType, ExternalPackageState(..), emptyModDetails )
import OccName
import Var ( Id, TyVar, idType )
-import Module ( moduleUserString )
+import Module ( moduleString )
import TcRnMonad
import IfaceEnv ( lookupOrig )
import Class ( Class, classExtraBigSig )
; return (mkAppTy q_ty (mkListTy decl_ty))
-- Result type is Q [Dec]
}
+
+tc_bracket (PatBr _)
+ = failWithTc (ptext SLIT("Tempate Haskell pattern brackets are not supported yet"))
\end{code}
qReport True msg = addErr (text msg)
qReport False msg = addReport (text msg)
- qCurrentModule = do { m <- getModule; return (moduleUserString m) }
+ qCurrentModule = do { m <- getModule; return (moduleString m) }
qReify v = reify v
qRecover = recoverM
ppr_ns (TH.Name _ (TH.NameG TH.VarName mod)) = text "var"
lookupThName :: TH.Name -> TcM Name
-lookupThName th_name
- = do { let rdr_name = thRdrName guessed_ns th_name
+lookupThName th_name@(TH.Name occ flavour)
+ = do { let rdr_name = thRdrName guessed_ns occ_str flavour
-- Repeat much of lookupOccRn, becase we want
-- to report errors in a TH-relevant way
}
where
-- guessed_ns is the name space guessed from looking at the TH name
- guessed_ns | isLexCon occ_fs = OccName.dataName
- | otherwise = OccName.varName
- occ_fs = mkFastString (TH.nameBase th_name)
+ guessed_ns | isLexCon (mkFastString occ_str) = OccName.dataName
+ | otherwise = OccName.varName
+ occ_str = TH.occString occ
tcLookupTh :: Name -> TcM TcTyThing
-- This is a specialised version of TcEnv.tcLookup; specialised mainly in that
-- have free variables, we may need to generate NameL's for them.
where
name = getName thing
- mod = moduleUserString (nameModule name)
- occ_str = occNameUserString occ
+ mod = moduleString (nameModule name)
+ occ_str = occNameString occ
occ = nameOccName name
mk_varg | OccName.isDataOcc occ = TH.mkNameG_d
| OccName.isVarOcc occ = TH.mkNameG_v