%
+% (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}
) `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
(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