plusLIEs, mkLIE, isEmptyLIE, lieToList, listToLIE,
Inst,
- pprInst, pprInsts, pprInstsInFull, tidyInsts,
+ pprInst, pprInsts, pprInstsInFull, tidyInsts, tidyMoreInsts,
newDictsFromOld, newDicts,
newMethod, newMethodWithGivenTy, newOverloadedLit,
import NameSet ( NameSet )
import PprType ( pprPred )
import Subst ( emptyInScopeSet, mkSubst,
- substTy, substTheta, mkTyVarSubst, mkTopTyVarSubst
+ substTy, substTyWith, substTheta, mkTyVarSubst, mkTopTyVarSubst
)
import Literal ( inIntRange )
import VarEnv ( TidyEnv, lookupSubstEnv, SubstResult(..) )
zonkLIE lie = mapBagNF_Tc zonkInst lie
pprInsts :: [Inst] -> SDoc
-pprInsts insts = parens (sep (punctuate comma (map pprInst insts)))
+pprInsts insts = parens (sep (punctuate comma (map pprInst insts)))
pprInstsInFull insts
= -- Get the Id type and instantiate it at the specified types
let
(tyvars, rho) = tcSplitForAllTys (idType id)
- rho_ty = substTy (mkTyVarSubst tyvars tys) rho
+ rho_ty = substTyWith tyvars tys rho
(pred, tau) = tcSplitMethodTy rho_ty
in
newMethodWithGivenTy orig id tys [pred] tau
tidyInst env (Dict u pred loc) = Dict u (tidyPred env pred) loc
tidyInst env (Method u id tys theta tau loc) = Method u id (tidyTypes env tys) theta tau loc
-tidyInsts :: [Inst] -> (TidyEnv, [Inst])
+tidyMoreInsts :: TidyEnv -> [Inst] -> (TidyEnv, [Inst])
-- This function doesn't assume that the tyvars are in scope
-- so it works like tidyOpenType, returning a TidyEnv
-tidyInsts insts
- = (env, map (tidyInst env) insts)
+tidyMoreInsts env insts
+ = (env', map (tidyInst env') insts)
where
- env = tidyFreeTyVars emptyTidyEnv (tyVarsOfInsts insts)
+ env' = tidyFreeTyVars env (tyVarsOfInsts insts)
+
+tidyInsts :: [Inst] -> (TidyEnv, [Inst])
+tidyInsts insts = tidyMoreInsts emptyTidyEnv insts
\end{code}
other -> returnNF_Tc Nothing
\end{code}
-
-