From: simonpj@microsoft.com Date: Tue, 3 Oct 2006 15:30:57 +0000 (+0000) Subject: Make recursion and RULES interact better X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c248518fe81b6d2807d3bcbb8a09ae14facce1ad;hp=c248518fe81b6d2807d3bcbb8a09ae14facce1ad;p=ghc-hetmet.git Make recursion and RULES interact better See Trac #683 This patch improves the interaction of recursion and RULES; at least I hope it does. The problem was that a RULE was being treated uniformly like an "extra RHS". This worked badly when you have a non-recursive definition that is made recursive only by RULE. This patch maeks the occurrence analyser know whether a binder is referred to only from RULES (the RulesOnly constructor in OccInfo). Then we can ignore such edges when deciding on the order of bindings in a letrec, and when setting the LoopBreaker flag. The remaining potential problem is this: rec{ f = ...g... ; g = ...f... RULE g True = ... } The RULE for g may not be visible in f's rhs. This is fixable, but not today. ---