haskell array access

Simon Peyton-Jones simonpj@microsoft.com
Tue, 1 Jul 2003 17:00:36 +0100


| Are there any concoctions of flags/pragmas/techniques to coax GHC into
| unrolling a function (or rather an IO computation in this case) a
couple
| of iterations. There was another (admittedly also noddy) program that
I
| could get to near gcc, but only by unrolling by hand (though Ian's TH
| stuff likely could have done it).

GHC generally doesn't unroll recursions.  The inliner runs repeatedly,
so it's hard for it to know how much it unrolled "last time".  (There's
a paper "Secrets of the GHC inliner" on my publications page.)

Simon