patch applied (ghc): Improve liberate-case to take account of coercions

Simon Peyton Jones simonpj at microsoft.com
Wed Oct 4 09:55:44 EDT 2006


Wed Oct  4 06:51:55 PDT 2006  simonpj at microsoft.com
  * Improve liberate-case to take account of coercions
  
  Note [Scrutinee with cast]
  ~~~~~~~~~~~~~~~~~~~~~~~~~~
  Consider this:
      f = \ t -> case (v `cast` co) of
  	         V a b -> a : f t
  
  Exactly the same optimistaion (unrolling one call to f) will work here, 
  despite the cast.  See mk_alt_env in the Case branch of libCase.
  
  This patch does the job.  For a change, it was really easy.
  

    M ./compiler/simplCore/LiberateCase.lhs -4 +13


More information about the Cvs-ghc mailing list