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.