[GHC] #9545: Evaluate Takano Akio's foldrW/buildW fusion framework as a possible replacement for foldr/build

GHC ghc-devs at haskell.org
Fri Sep 5 06:32:53 UTC 2014


#9545: Evaluate Takano Akio's foldrW/buildW fusion framework as a possible
replacement for foldr/build
-------------------------------------+-------------------------------------
              Reporter:  dfeuer      |            Owner:
                  Type:  task        |           Status:  new
              Priority:  normal      |        Milestone:
             Component:              |          Version:  7.9
  libraries/base                     |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Project (more
  Unknown/Multiple                   |  than a week)
       Type of failure:              |       Blocked By:
  None/Unknown                       |  Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 === Update ===

 Takano Akio's draft implementation has one or a few saturation issues and
 missing pragmas that prevent some necessary inlining when the fusion
 pipeline is not "capped" with a `foldrW`. This seems easy to fix, and I
 have done so for `map`.

 Dan Doel recognized that `foldrW/buildW` fusion, applied to situations
 currently handled with `foldr/build`, tends to produce recursive forms
 that pass a static argument around and around without touching it. He
 discovered that a modified version of `buildW`, call it `buildWForgetful`
 for now, can be used instead of `buildW` when recursion defining the
 builder satisfies a simple condition common to many important examples.

 One serious difficulty in dealing with this framework is the difficulty of
 ''understanding'' it.

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


More information about the ghc-tickets mailing list