Float casts out of lambdas
authorsimonpj@microsoft.com <unknown>
Mon, 5 Feb 2007 17:35:44 +0000 (17:35 +0000)
committersimonpj@microsoft.com <unknown>
Mon, 5 Feb 2007 17:35:44 +0000 (17:35 +0000)
commit4539cb1bc16136ac60bbb0cac712fc9a6fe99c48
tree86b959a0a88407e903f1596a364c7538cf65d719
parent7f7b6cefcfbcf81ca3abd18c65498c5ba4860204
Float casts out of lambdas

See Note [Casts and lambdas] in SimplUtils.  I found this transformation
when staring at some cast-heavy code generated by
Language.Haskell.Lexer.hs in the haskell-src library.

The basic transformation is this:
(\x. e `cast` g1)  -->  (\x.e) `cast` (tx -> g1)
where x:tx.
compiler/simplCore/SimplUtils.lhs