Improve liberate-case to take account of coercions
authorsimonpj@microsoft.com <unknown>
Wed, 4 Oct 2006 13:51:55 +0000 (13:51 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 4 Oct 2006 13:51:55 +0000 (13:51 +0000)
commit21174275446082358e427adec454d7e1c183fd37
tree27ba6565888ce99df91815f4407e8362db4df40f
parentd3ff6e08657a785616eb45860bae07de3032a950
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.
compiler/simplCore/LiberateCase.lhs