
On Tue, Jul 22, 2014 at 6:42 PM, David Feuer
I'm looking for some help writing some translate/untranslate rules to implement fusion for a couple of basic functions (the ones I'm looking at right now are takeWhile and scanr, but there may be others). I have a translation for takeWhile that seems to be at least decent, and one for scanr that is completely untested. I've never mucked about with GHC RULES, however, so I don't even know where to begin.
Probably the best place to start is to take a look at the source for GHC.Base and GHC.List, in particular the rules for map and filter capture the overarching pattern of how to stage the different rules. http://hackage.haskell.org/package/base-4.7.0.1/docs/src/GHC-Base.html#map http://hackage.haskell.org/package/base-4.7.0.1/docs/src/GHC-List.html#filte... -- Live well, ~wren