Skip to content

Implement foldr/cons/build

There seem to be various issues with general fold/cons and even cons/build rules, but it seems pretty clear to me that the simple fold/cons/build rule is a good idea. It doesn't do much for nofib allocation, but it seems to improve some other analyses and speed several benchmarks up, including speeding up some things that other fusion changes slowed down. I say "seems to" because I never trust my timings much at all.

{-# RULES
"foldr/cons/build" forall c n x (g::forall b. (a->b->b) -> b -> b) .
                           foldr c n (x:build g) = c x (g c n)
 #-}
Trac metadata
Trac field Value
Version 7.9
Type Task
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC ekmett, hvr
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information