How many HOFs in Phobos?

bearophile bearophileHUGS at lycos.com
Mon Jan 31 16:02:05 PST 2011


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


More information about the Digitalmars-d mailing list