[Haskell-beginners] Using my first map instance

Daniel Trstenjak daniel.trstenjak at gmail.com
Sun Sep 30 11:11:42 CEST 2012

Hi Darren,

Am 30.09.2012 09:02 schrieb "Darren Grant"
> This is exactly the kind of recursive function I was trying to set up
> with map, but didn't get the algorithm right. I expect the immutable
> Array must be much lighter weight than the immutable Map.

using an array as cache is the fastes approach.

I implemented a C++ version using an array (~0.03s) which is orders of
magnitude faster than the map version (~2.5s).

I also tried a Haskell version with an unboxed, mutable Data.Vector using
explict tail recursion, but this version was only 2 times faster than a
lazy Data.Vector version (~0.4s).

I would like to see a Haskell version which is in the same ballpark than
the fastes C++ version, but still quite high level.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20120930/3e660698/attachment.htm>

More information about the Beginners mailing list