[GHC] #9536: Implement foldr/cons/build

GHC ghc-devs at haskell.org
Mon Sep 1 22:02:20 UTC 2014


#9536: Implement foldr/cons/build
-------------------------------------+-------------------------------------
       Reporter:  dfeuer             |                   Owner:
           Type:  task               |                  Status:  new
       Priority:  normal             |               Milestone:  7.8.4
      Component:  libraries/base     |                 Version:  7.9
       Keywords:  fusion             |        Operating System:
   Architecture:  Unknown/Multiple   |  Unknown/Multiple
     Difficulty:  Easy (less than 1  |         Type of failure:
  hour)                              |  None/Unknown
     Blocked By:                     |               Test Case:
Related Tickets:                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 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.

 {{{#!hs
 {-# 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)
  #-}
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9536>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list