pprInstInfoDetails, tcLookupTyCon, tcExtendTyVarEnv
)
import TcGenDeriv -- Deriv stuff
-import InstEnv ( InstEnv, simpleDFunClassTyCon )
+import InstEnv ( simpleDFunClassTyCon )
import TcMonoType ( tcHsPred )
import TcSimplify ( tcSimplifyDeriv )
import RnBinds ( rnMethodBinds, rnTopMonoBinds )
-import RnEnv ( bindLocalsFVRn )
+import RnEnv ( bindLocalsFV )
import TcRnMonad ( thenM, returnM, mapAndUnzipM )
import HscTypes ( DFunId )
import Subst ( mkTyVarSubst, substTheta )
import ErrUtils ( dumpIfSet_dyn )
import MkId ( mkDictFunId )
-import DataCon ( dataConRepArgTys, dataConOrigArgTys, isNullaryDataCon, isExistentialDataCon )
+import DataCon ( dataConOrigArgTys, isNullaryDataCon, isExistentialDataCon )
import Maybes ( maybeToBool, catMaybes )
import Name ( Name, getSrcLoc, nameUnique )
import NameSet
-- Rename to get RenamedBinds.
-- The only tricky bit is that the extra_binds must scope
-- over the method bindings for the instances.
- bindLocalsFVRn (ptext (SLIT("deriving"))) mbinders $ \ _ ->
- rnTopMonoBinds extra_mbinds [] `thenM` \ (rn_extra_binds, fvs) ->
+ bindLocalsFV (ptext (SLIT("deriving"))) mbinders $ \ _ ->
+ rnTopMonoBinds extra_mbinds [] `thenM` \ (rn_extra_binds, dus) ->
mapAndUnzipM rn_meths method_binds_s `thenM` \ (rn_method_binds_s, fvs_s) ->
returnM ((rn_method_binds_s, rn_extra_binds),
- fvs `plusFV` plusFVs fvs_s)
+ duUses dus `plusFV` plusFVs fvs_s)
) `thenM` \ ((rn_method_binds_s, rn_extra_binds), fvs) ->
let
new_inst_infos = zipWith gen_inst_info new_dfuns rn_method_binds_s
constraints = extra_constraints ++
[ mkClassPred clas [arg_ty]
| data_con <- tyConDataCons tycon,
- arg_ty <- dataConRepArgTys data_con, -- dataConOrigArgTys???
+ arg_ty <- dataConOrigArgTys data_con,
-- Use the same type variables
-- as the type constructor,
-- hence no need to instantiate