newTyVarTy, newTyVarTys, zonkTcType, readHoleResult )
import TcType ( TcType, TcSigmaType, TcRhoType, TyVarDetails(VanillaTv),
tcSplitFunTys, tcSplitTyConApp, mkTyVarTys,
- isSigmaTy, isTauTy, mkFunTy, mkFunTys,
+ isSigmaTy, mkFunTy, mkFunTys,
mkTyConApp, mkClassPred, tcFunArgTy,
tyVarsOfTypes, isLinearPred,
liftedTypeKind, openTypeKind,
import FieldLabel ( FieldLabel, fieldLabelName, fieldLabelType, fieldLabelTyCon )
import Id ( Id, idType, recordSelectorFieldLabel, isRecordSelector, isDataConWrapId_maybe )
import DataCon ( DataCon, dataConFieldLabels, dataConSig, dataConStrictMarks )
-import Name ( Name, isExternalName )
+import Name ( Name )
import TyCon ( TyCon, tyConTyVars, tyConTheta, isAlgTyCon, tyConDataCons )
import Subst ( mkTopTyVarSubst, substTheta, substTy )
import VarSet ( emptyVarSet, elemVarSet )
tcMonoExpr (HsReify (Reify flavour name)) res_ty
= addErrCtxt (ptext SLIT("At the reification of") <+> ppr name) $
- tcLookupGlobal name `thenM` \ thing ->
- -- For now, we can only reify top-level things
- -- The complication for non-top-level things is just that
- -- they might be a TcId, and need zonking etc.
-
tcMetaTy tycon_name `thenM` \ reify_ty ->
unifyTauTy res_ty reify_ty `thenM_`
-
- returnM (HsReify (ReifyOut flavour thing))
+ returnM (HsReify (ReifyOut flavour name))
where
tycon_name = case flavour of
ReifyDecl -> DsMeta.decTyConName
| want_method_inst fun_ty
= tcInstType VanillaTv fun_ty `thenM` \ (tyvars, theta, tau) ->
newMethodWithGivenTy orig fun_id
- (mkTyVarTys tyvars) theta tau `thenM` \ meth ->
- loop (HsVar (instToId meth)) tau
+ (mkTyVarTys tyvars) theta tau `thenM` \ meth_id ->
+ loop (HsVar meth_id) tau
loop fun fun_ty
| isSigmaTy fun_ty