[project @ 2002-10-09 15:51:43 by simonpj]
[ghc-hetmet.git] / ghc / compiler / typecheck / TcRules.lhs
index 533971f..fb3464d 100644 (file)
@@ -86,17 +86,16 @@ tcRule (HsRule name act vars lhs rhs src_loc)
        --      RULE:  forall v. fst (ss v) = fst v
        -- The type of the rhs of the rule is just a, but v::(a,(b,c))
        --
-       -- It's still conceivable that there may be type variables mentioned
-       -- in the LHS, but not in the type of the lhs, nor in the binders.
-       -- They'll get zapped to (), but that's over-constraining really.
-       -- Let's see if we get a problem.
+       -- We also need to get the free tyvars of the LHS; but we do that
+       -- during zonking (see TcHsSyn.zonkRule)
+       --
        forall_tvs = tyVarsOfTypes (rule_ty : map idType tpl_ids)
     in
-
        -- RHS can be a bit more lenient.  In particular,
        -- we let constant dictionaries etc float outwards
        --
-       -- 
+       -- NB: tcSimplifyInferCheck zonks the forall_tvs, and 
+       --     knocks out any that are constrained by the environment
     tcSimplifyInferCheck (text "tcRule")
                         forall_tvs
                         lhs_dicts rhs_lie      `thenM` \ (forall_tvs1, rhs_binds) ->