Make rule-matching robust to lets
authorsimonpj@microsoft.com <unknown>
Thu, 25 May 2006 15:44:47 +0000 (15:44 +0000)
committersimonpj@microsoft.com <unknown>
Thu, 25 May 2006 15:44:47 +0000 (15:44 +0000)
commit7656f8c4bd8d786bf83c1ab2dca0cdd1a903e5bf
treec8a25e99fb024b6ea05f33dc60d7d9a8c5cb768d
parent36f5406a714f0f1225377a7d601358ee7146fae8
Make rule-matching robust to lets

Consider a RULE like
forall arr. splitD (joinD arr) = arr

Until now, this rule would not match code of form
splitD (let { d = ... } in joinD (...d...))
because the 'let' got in the way.

This patch makes the rule-matcher robust to lets.  See comments with
the Let case of Rules.match.

This improvement is highly desirable in the fusion rules for NDP
stuff that Roman is working on, where we are doing fusion of *overloaded*
functions (which may look lazy).  The let expression that Roman tripped
up on was a dictioary binding.
compiler/basicTypes/VarEnv.lhs
compiler/coreSyn/CoreFVs.lhs
compiler/specialise/Rules.lhs