Opened 7 years ago

Closed 7 years ago

#7837 closed bug (fixed)

Rules involving equality constraints don't fire

Reported by: akio Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.2
Keywords: equality constraint, rules Cc: pho@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Runtime performance bug Test Case: indexed-types/should_compile/T7837
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


In the attached program, the "normalize/Double" rule doesn't fire, whereas "normalize'/Double" does.

In general, it seems that a rule doesn't fire if it involves discharging an equality constraint that is required by the LHS.

Attachments (2)

Rule.hs (958 bytes) - added by akio 7 years ago.
rule_main.hs (136 bytes) - added by akio 7 years ago.

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by akio

Attachment: Rule.hs added

Changed 7 years ago by akio

Attachment: rule_main.hs added

comment:1 Changed 7 years ago by PHO

Cc: pho@… added

comment:2 Changed 7 years ago by simonpj@…

commit 29cc690e8a6c154973de27d7bb49aa2a47b51dc7

Author: Simon Peyton Jones <>
Date:   Tue Apr 16 10:33:13 2013 +0100

    Make the desugarer a tiny bit cleverer on coercions (fixes Trac #7837)
    The desugarer was generating a redundant box/unbox pair on the
    LHS of a RULE, which in turn made matching fail.
    See Note [Simple coercions] in DsBinds.

 compiler/deSugar/DsBinds.lhs |   33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)

comment:3 Changed 7 years ago by simonpj

difficulty: Unknown
Resolution: fixed
Status: newclosed
Test Case: indexed-types/should_compile/T7837

Ah, yes, good point thank you. Fixed!


Note: See TracTickets for help on using tickets.