[Haskell-cafe] forLoop + strict State monad is much faster than foldl'
mail at nh2.me
Thu May 1 17:40:47 UTC 2014
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:
> 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:
> I have added the bench mark to my fork of your repo, and made a pull
> 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:
More information about the Haskell-Cafe