Ticket #7374 (new bug)
rule not firing
| Reported by: | igloo | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.8.1 |
| Component: | Compiler | Version: | 7.6.1 |
| Keywords: | Cc: | kazu@…, carter.schonwald@…, duncan@…, pho@… | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
In the code below, the rule appears not to fire.
Based on the bytestring rules, reported as broken here: http://www.haskell.org/pipermail/glasgow-haskell-users/2012-August/022775.html
ghc -O --make h.hs -ddump-simpl -fforce-recomp -Wall
module Q (f) where
{-# NOINLINE f #-}
f :: Bool -> String
f c = g ((==) c)
{-# NOINLINE g #-}
g :: (Bool -> Bool) -> String
g _ = "g"
h :: Bool -> String
h _ = "h"
{-# RULES "MyRule" forall x . g ((==) x) = h x #-}
==================== Tidy Core ====================
Result size of Tidy Core = {terms: 25, types: 21, coercions: 0}
lvl_rkK :: GHC.Types.Char
[GblId, Caf=NoCafRefs, Str=DmdType m]
lvl_rkK = GHC.Types.C# 'h'
lvl1_rkL :: [GHC.Types.Char]
[GblId, Caf=NoCafRefs, Str=DmdType]
lvl1_rkL =
GHC.Types.:
@ GHC.Types.Char lvl_rkK (GHC.Types.[] @ GHC.Types.Char)
h_reA :: GHC.Types.Bool -> GHC.Base.String
[GblId, Arity=1, Caf=NoCafRefs, Str=DmdType A]
h_reA = \ _ -> lvl1_rkL
lvl2_rkM :: GHC.Types.Char
[GblId, Caf=NoCafRefs, Str=DmdType m]
lvl2_rkM = GHC.Types.C# 'g'
lvl3_rkN :: [GHC.Types.Char]
[GblId, Caf=NoCafRefs, Str=DmdType]
lvl3_rkN =
GHC.Types.:
@ GHC.Types.Char lvl2_rkM (GHC.Types.[] @ GHC.Types.Char)
g_rez :: (GHC.Types.Bool -> GHC.Types.Bool) -> GHC.Base.String
[GblId, Arity=1, Caf=NoCafRefs, Str=DmdType A]
g_rez = \ _ -> lvl3_rkN
Q.f [InlPrag=NOINLINE] :: GHC.Types.Bool -> GHC.Base.String
[GblId, Arity=1, Caf=NoCafRefs, Str=DmdType A]
Q.f =
\ (c_aeC :: GHC.Types.Bool) ->
g_rez (GHC.Classes.$fEqBool_$c== c_aeC)
Change History
Note: See
TracTickets for help on using
tickets.
