[GHC] #10595: BuiltinRules override other rules in some cases.

GHC ghc-devs at haskell.org
Tue Jul 7 20:25:30 UTC 2015


#10595: BuiltinRules override other rules in some cases.
-------------------------------------+-------------------------------------
        Reporter:  gjsimms           |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  high              |               Milestone:
       Component:  Compiler          |                 Version:  7.11
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:                    |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by gjsimms):

 I am happy with the workaround/documentation at this point: Just to note,
 this can be done almost entirely in the Rule system by substituting into
 temporary functions. So class-methods can be used normally with rewrite
 rules.
 {{{
 {-# INLINE [1] f' #-}
 f' = f
 {-# RULES f = f' #-}
 {-# RULES (exp1 (f' ...) ...) = exp2) #-}
 }}}

 Long term I think it would be most clear if BuiltinRules had no effect on
 user supplied rewrite rules.

 This does affect some current libraries e.g. all the RULES in
 Control.Arrow do nothing, I do not know if/how it affects other libraries.

 Feel free to close. I do think it is worthwhile making note of in case the
 simplifier gets overhauled at any point in the future.

 ida' idb' above can be inlined in the above (all phases) and the rule will
 still fire for me, I figure this may be somewhat random.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10595#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list