patch applied (ghc): Make let-matching work in Rules again

Simon Peyton Jones simonpj at microsoft.com
Tue Feb 27 18:15:37 EST 2007


Tue Feb 27 15:13:13 PST 2007  simonpj at microsoft.com
  * Make let-matching work in Rules again
  
  A RULE is supposed to match even if there is an intervening let:
  	RULE f (x:xs) = ....
  	target	   f (let x = thing in x:xs)
  
  It's surprisingly tricky to get this right; in effect we are doing
  let-floating on the fly. I managed to get it wrong before, or at least
  be over-conservative.  And in "fixing" that I got it wrong again in a
  different way, which made it far too conservative. In particular, it
  failed to match	f (let x = y+y in let z=x+y in z:xs)
  because the binder x was cloned and looked "locally-bound". See the
  ever growing comments with the Let rule for details.
  
  That patch reverts to the previous story, which is still a bit too 
  conservative, but not so egregiously so.  Fixes Romans's problem.
  

    M ./compiler/specialise/Rules.lhs -1 +23



More information about the Cvs-ghc mailing list