add foldr/build optimisation for take and replicate
authorSimon Marlow <simonmar@microsoft.com>
Thu, 26 Jan 2006 16:46:03 +0000 (16:46 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Thu, 26 Jan 2006 16:46:03 +0000 (16:46 +0000)
commit15d66dbc071acb00422d69bac50d6a8bfc87a070
treec136ecebc83293b83b0b5b91abe85e0c9df6fa50
parent2badbeeedb47fa79e712273759c45027d1b06649
add foldr/build optimisation for take and replicate
This allows take to be deforested, and improves performance of
replicate and replicateM/replicateM_.  We have a separate problem that
means expressions involving [n..m] aren't being completely optimised
because eftIntFB isn't being inlined but otherwise the results look
good.

Sadly this has invalidated a number of the nofib benchmarks which were
erroneously using take to duplicate work in a misguided attempt to
lengthen their runtimes (ToDo).
GHC/List.lhs