[project @ 1996-05-01 18:36:59 by partain]
[ghc-hetmet.git] / ghc / compiler / typecheck / TcDeriv.lhs
index 6e29cc6..778a28a 100644 (file)
@@ -8,9 +8,7 @@ Handles @deriving@ clauses on @data@ declarations.
 \begin{code}
 #include "HsVersions.h"
 
-module TcDeriv (
-       tcDeriving
-    ) where
+module TcDeriv ( tcDeriving ) where
 
 import Ubiq
 
@@ -21,7 +19,7 @@ import HsPragmas      ( InstancePragmas(..) )
 import RnHsSyn         ( RenamedHsBinds(..), RenamedFixityDecl(..) )
 import TcHsSyn         ( TcIdOcc )
 
-import TcMonad
+import TcMonad         hiding ( rnMtoTcM )
 import Inst            ( InstOrigin(..), InstanceMapper(..) )
 import TcEnv           ( getEnv_TyCons )
 import TcKind          ( TcKind )
@@ -34,7 +32,7 @@ import RnUtils                ( RnEnv(..) )
 import RnBinds         ( rnMethodBinds, rnTopBinds )
 
 import Bag             ( emptyBag{-ToDo:rm-}, Bag, isEmptyBag, unionBags, listToBag )
-import Class           ( GenClass, getClassKey )
+import Class           ( GenClass, classKey )
 import CmdLineOpts     ( opt_CompilingPrelude )
 import ErrUtils                ( pprBagOfErrors, addErrLoc, Error(..) )
 import Id              ( dataConSig, dataConArity )
@@ -281,7 +279,7 @@ makeDerivEqns
     chk_out :: [(Class, TyCon)] -> (Class, TyCon) -> TcM s ()
     chk_out whole_deriving_list this_one@(clas, tycon)
       =        let
-           clas_key = getClassKey clas
+           clas_key = classKey clas
        in
 
            -- Are things OK for deriving Enum (if appropriate)?
@@ -563,7 +561,7 @@ gen_inst_info modname fixities deriver_rn_env
                       (if from_here then mbinds else EmptyMonoBinds)
                       from_here modname locn [])
   where
-    clas_key = getClassKey clas
+    clas_key = classKey clas
     clas_Name
       = let  (mod, nm) = moduleNamePair clas  in
        ClassName clas_key (mkPreludeCoreName mod nm) []
@@ -672,7 +670,7 @@ gen_taggery_Names eqns
       where
        is_in_eqns clas_key tycon [] = False
        is_in_eqns clas_key tycon ((c,t,_,_):eqns)
-         =  (clas_key == getClassKey c && tycon == t)
+         =  (clas_key == classKey c && tycon == t)
          || is_in_eqns clas_key tycon eqns
 
 \end{code}