Andrei:

> Thanks for this work.

My pleasure :-)


> The Haskell implementation doesn't scale.

I was quite aware that Haskell version is designed for being short, not fast. 
But I was not aware of the precise trends of the various versions, and I am 
surprised to see how much efficient is my ugly D2 version compared to that 
fully lazy Haskell version. As usual doing experiments teaches something :-)


> My testbed:

This time it's you doing the bencharks :-)
If you want you may benchmark this version too, adapted to D2 from my dlibs1, 
the timings I'm seeing here are interesting:
http://codepad.org/Kf2FMMN9
Uncommenting a different lines of code it allows you to benchmark three 
versions, two from Phobos2.


> Note that reduce is akin to foldl, not foldr.

Sorry for my mistake.

Bye and thank you,
bearophile

Reply via email to