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)
commit9f29faa82d8159f10561864f27cf1a2d80d73b75
tree1ec057f70614de70bed271e0c8b637bbcf19c29f
parentfe2c41ba6ed2dfd24c0508adb61897dd36206685
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).
libraries/base/GHC/List.lhs