patch applied (ghc): Fix constraint handling for lazy patterns

Simon Peyton Jones simonpj at microsoft.com
Fri Nov 24 18:15:17 EST 2006


Fri Nov 24 15:05:48 PST 2006  simonpj at microsoft.com
  * Fix constraint handling for lazy patterns
  
  Lazy patterns are quite tricky!  Consider
  	f ~(C x) = 3
  Can the Num constraint from the 3 be discharged by a Num dictionary
  bound by the pattern?  Definitely not!  
  
  See Note [Hopping the LIE in lazy patterns] in TcPat
  
  The type checker wasn't ensuring this, and that was causing all
  manner of strange things to happen.  It actually manifested as a
  strictness bug reported by Sven Panne.
  
  I've added his test case as tcrun040.
  

    M ./compiler/hsSyn/HsUtils.lhs -6 +13
    M ./compiler/typecheck/TcPat.lhs -4 +19


More information about the Cvs-ghc mailing list