[project @ 2002-04-29 14:03:38 by simonmar]
[ghc-hetmet.git] / ghc / compiler / typecheck / TcRules.lhs
index f4d8a85..f5ddf1e 100644 (file)
@@ -11,20 +11,17 @@ module TcRules ( tcIfaceRules, tcSourceRules ) where
 import HsSyn           ( RuleDecl(..), RuleBndr(..), collectRuleBndrSigTys )
 import CoreSyn         ( CoreRule(..) )
 import RnHsSyn         ( RenamedRuleDecl )
-import HscTypes                ( PackageRuleBase )
 import TcHsSyn         ( TypecheckedRuleDecl, mkHsLet )
 import TcMonad
 import TcSimplify      ( tcSimplifyToDicts, tcSimplifyInferCheck )
 import TcMType         ( newTyVarTy )
 import TcType          ( tyVarsOfTypes, openTypeKind )
-import TcIfaceSig      ( tcCoreExpr, tcCoreLamBndrs, tcVar, tcDelay )
+import TcIfaceSig      ( tcCoreExpr, tcCoreLamBndrs, tcVar )
 import TcMonoType      ( tcHsSigType, UserTypeCtxt(..), tcAddScopedTyVars )
-import TcExpr          ( tcExpr )
-import TcEnv           ( RecTcEnv, tcExtendLocalValEnv, isLocalThing, tcLookupId )
+import TcExpr          ( tcMonoExpr )
+import TcEnv           ( tcExtendLocalValEnv, tcLookupId )
 import Inst            ( LIE, plusLIEs, emptyLIE, instToId )
-import Id              ( idName, idType, mkLocalId )
-import Module          ( Module )
-import List            ( partition )
+import Id              ( idType, mkLocalId )
 import Outputable
 \end{code}
 
@@ -66,12 +63,12 @@ tcSourceRule (HsRule name act vars lhs rhs src_loc)
     tcAddScopedTyVars (collectRuleBndrSigTys vars) (
 
                -- Ditto forall'd variables
-       mapNF_Tc new_id vars                                    `thenNF_Tc` \ ids ->
-       tcExtendLocalValEnv [(idName id, id) | id <- ids]       $
+       mapNF_Tc new_id vars                            `thenNF_Tc` \ ids ->
+       tcExtendLocalValEnv ids                         $
        
                -- Now LHS and RHS
-       tcExpr lhs rule_ty                                      `thenTc` \ (lhs', lhs_lie) ->
-       tcExpr rhs rule_ty                                      `thenTc` \ (rhs', rhs_lie) ->
+       tcMonoExpr lhs rule_ty                          `thenTc` \ (lhs', lhs_lie) ->
+       tcMonoExpr rhs rule_ty                          `thenTc` \ (rhs', rhs_lie) ->
        
        returnTc (ids, lhs', rhs', lhs_lie, rhs_lie)
     )                                          `thenTc` \ (ids, lhs', rhs', lhs_lie, rhs_lie) ->
@@ -127,7 +124,7 @@ tcSourceRule (HsRule name act vars lhs rhs src_loc)
                                     returnNF_Tc (mkLocalId var ty)
 
 ruleCtxt name = ptext SLIT("When checking the transformation rule") <+> 
-               doubleQuotes (ptext name)
+               doubleQuotes (ftext name)
 \end{code}