[GHC] #12640: Class member functions not substituted for MultiParamTypeClasses

#12640: Class member functions not substituted for MultiParamTypeClasses -------------------------------------+------------------------------------- Reporter: jeremy-list | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Runtime Unknown/Multiple | performance bug Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- When the following code is compiled with "-O2 -ddump-rule-firings" the rule is not fired: presumably because the simplifier does not recognize that (+++) = ex_or. {{{#!hs {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-} class Ex2 a b c | a b -> c where (+++) :: a -> b -> c instance Ex2 Bool Bool Bool where (+++) = ex_or {-# INLINE [2] ex_or #-} ex_or = (||) {-# RULES "force-inline" forall a b . ex_or a b = a || b #-} main = print (True +++ True) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12640 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12640: Class member functions not substituted for MultiParamTypeClasses -------------------------------------+------------------------------------- Reporter: jeremy-list | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by akio): Changing the `INLINE [2]` to `INLINE [1]` allows the rule to fire. I believe the issue is that an `INLINE [2]` is essentially the same as an `INLINE` with no phase specifier, because by default `2` is the first simplifier phase. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12640#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12640: Class member functions not substituted for MultiParamTypeClasses -------------------------------------+------------------------------------- Reporter: jeremy-list | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Akio is correct. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12640#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC