Rewrite rule not firing for typeclass
The following rewrite rule fires for a normal function, but fails to fire as the method of a typeclass.
{-# OPTIONS_GHC -O -ddump-rule-firings #-}
module RewriteProblems where
{-# RULES
"rewrite/class" forall a. id1 (id1 a) = RDUnit
"rewrite/static" forall a. id1' (id1' a) = RDUnit
#-}
class Ider a where
id1 :: a -> a
data RewriteD = RDUnit
instance Ider RewriteD where
{-# INLINE[1] id1 #-}
id1 a = RDUnit
classTest :: RewriteD
classTest = id1 (id1 RDUnit)
staticTest :: RewriteD
staticTest = id1' (id1' RDUnit)
{-# INLINE[1] id1' #-}
id1' :: RewriteD -> RewriteD
id1' a = RDUnit
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.4.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |