
Nice find, I merged your benchmark addition. Would you mind making a GHC issue from your `enumFromTo` findings? On 01/05/14 15:17, Patrick Wheeler wrote:
@Niklas
You can use the `foldM` form the FoldL package to achieve equal results as the fastest loops in your current benchmark. foldM will allow you to deal with your loops at a high level of abstraction though. See the following post, by Gabriel Gonzalez, for an example: http://www.haskellforall.com/2013/08/foldl-100-composable-streaming-and.html
I have added the bench mark to my fork of your repo, and made a pull request: https://github.com/Davorak/loop
It looks like the only reason that `foldM` does not preform well with `Word32` is because of the naive implementation of `enumFromTo` for Word32 as explained in my other email in more detail.
Here is the Criterion report: http://htmlpreview.github.io/?https://github.com/Davorak/loop/blob/master/re...