
#9136: Constant folding in Core could be better --------------------------------------------+------------------------------ Reporter: simonpj | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime performance bug | Unknown/Multiple Test Case: | Difficulty: Unknown Blocking: | Blocked By: | Related Tickets: --------------------------------------------+------------------------------ Comment (by nomeata): Care to explain? `(x +# y) -# z = x +# (y -# z)` looks very much like rewriting to me, and rewrite rules are a powerful mechanism for that. And if we were able to specify that declaratively in source code, instead of letting the compiler grow and grow, even better, I’d say. Also note that constant folding is also done with (built-in, more powerful) RULES already. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9136#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler