Improve handling of partial applications involving casts
authorsimonpj@microsoft.com <unknown>
Mon, 5 Feb 2007 17:40:58 +0000 (17:40 +0000)
committersimonpj@microsoft.com <unknown>
Mon, 5 Feb 2007 17:40:58 +0000 (17:40 +0000)
commitb2cc243ada84e94e37e4b9442b11bf59da6f2469
tree8d6e7aff516a40f2de6419edb00d64a4765320e9
parent4539cb1bc16136ac60bbb0cac712fc9a6fe99c48
Improve handling of partial applications involving casts

This patch improves prepareRhs, so that it deals better with casts.

We want to deal well cases like this
v = (f e1 `cast` co) e2
Here we want to make e1,e2 trivial and get
x1 = e1; x2 = e2; v = (f x1 `cast` co) v2

This really happens in parser libraries, which wrap functions in newtypes.
compiler/simplCore/Simplify.lhs