[project @ 2003-04-08 11:01:00 by simonpj]
[ghc-hetmet.git] / ghc / compiler / typecheck / TcDeriv.lhs
index c7b7d64..10a7ff7 100644 (file)
@@ -22,12 +22,12 @@ import TcEnv                ( tcExtendTempInstEnv, newDFunName,
                          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 )
 
@@ -36,7 +36,7 @@ import Class          ( className, classArity, classKey, classTyVars, classSCTheta, Clas
 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
@@ -256,11 +256,11 @@ deriveOrdinaryStuff eqns
        -- 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
@@ -344,7 +344,7 @@ makeDerivEqns tycl_decls
        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