More import tidying and fixing the stage 2 build
[ghc-hetmet.git] / compiler / typecheck / TcRules.lhs
index b14c2c9..ef8e388 100644 (file)
@@ -1,25 +1,27 @@
 %
+% (c) The University of Glasgow 2006
 % (c) The AQUA Project, Glasgow University, 1993-1998
 %
-\section[TcRules]{Typechecking transformation rules}
+
+TcRules: Typechecking transformation rules
 
 \begin{code}
 module TcRules ( tcRules ) where
 
 #include "HsVersions.h"
 
-import HsSyn           ( RuleDecl(..), LRuleDecl, RuleBndr(..), mkHsDictLet )
+import HsSyn
 import TcRnMonad
-import TcSimplify      ( tcSimplifyToDicts, tcSimplifyInferCheck )
-import TcMType         ( newFlexiTyVarTy, zonkQuantifiedTyVar, tcSkolSigTyVars )
-import TcType          ( tyVarsOfTypes, openTypeKind, SkolemInfo(..), substTyWith, mkTyVarTys )
-import TcHsType                ( UserTypeCtxt(..), tcHsPatSigType )
-import TcExpr          ( tcMonoExpr )
-import TcEnv           ( tcExtendIdEnv, tcExtendTyVarEnv )
-import Inst            ( instToId )
-import Id              ( idType, mkLocalId )
-import Name            ( Name )
-import SrcLoc          ( noLoc, unLoc )
+import TcSimplify
+import TcMType
+import TcType
+import TcHsType
+import TcExpr
+import TcEnv
+import Inst
+import Id
+import Name
+import SrcLoc
 import Outputable
 \end{code}
 
@@ -43,7 +45,7 @@ tcRule (HsRule name act vars lhs fv_lhs rhs fv_rhs)
     )                          `thenM` \ (ids, lhs', rhs', lhs_lie, rhs_lie) ->
 
                -- Check that LHS has no overloading at all
-    getLIE (tcSimplifyToDicts lhs_lie) `thenM` \ (lhs_binds, lhs_dicts) ->
+    tcSimplifyRuleLhs lhs_lie  `thenM` \ (lhs_dicts, lhs_binds) ->
 
        -- Gather the template variables and tyvars
     let
@@ -86,7 +88,7 @@ tcRule (HsRule name act vars lhs fv_lhs rhs fv_rhs)
                    (map (RuleBndr . noLoc) (forall_tvs2 ++ tpl_ids))   -- yuk
                    (mkHsDictLet lhs_binds lhs') fv_lhs
                    (mkHsDictLet rhs_binds rhs') fv_rhs)
-  where
+
 
 tcRuleBndrs [] thing_inside = thing_inside []
 tcRuleBndrs (RuleBndr var : vars) thing_inside