
#9601: Make the rewrite rule system more powerful -------------------------------------+------------------------------------- Reporter: spacekitteh | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: #9137, #10804 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): I don't know much about `RULES`, let me highlight this idea from ticket:9136#comment:1 (that lead to #9137): {{{ forall x y z. (IsLiteral y, IsLiteral z) => (x +# y) -# z = x +# (y -# z) forall x y z. (IsLiteral y, IsLiteral z) => (x -# y) -# z = x -# (y +# z) ... }}} This strikes my fancy! It's like a type class (predicate) for syntax * Could `IsLiteral` be given a kind? * Which constraint can be made available? (`IsEven`, `IsOdd`, ...) * Which properties can the compiler make use of? * Which properties can the optimizer make use of? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9601#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler