Simplify and improve ConstantFold
When looking at
GHC.Core.Op.ConstantFold I found a number of ways in which it could be simpler and better.
- We have no rules for AddrEqOp. We should, for ("foo"# == "bar"#). NB: be sure to use exprIsLiteral_maybe so that we "see" the strings even if they are floated to top level. So don't use binaryLit
The generality of
pattern Lis never used. The
Lpattern is used only in
numFoldingRules; and it is only use for
Wordops. So wes sould never see a
Charliteral. So the
pattern Lis useless. We should simplify
pattern L l = Lit (LitNumber _ i _)(
Similarly, isLitValue_maybe in
caseRuleswill never see a
isLitValue_maybeis not called outside
Literal; don't export it.
Literal.isLitValue is never called: kill it.