Why is this code slow?

Hey guys, in my stumbling over Reddit I happened to find the following comment http://www.reddit.com/r/programming/comments/248abo/range_comprehensions_c/c..., where the poster shows a simple algorithm which is really slow when implemented in Haskell, compared to a C++ counterpart which does it the same way. I’ve tried to figure this out, but my profiling skills don’t seem to be good enough for this. I’m not sure if this is somehow a limitation of list comprehensions, or if something else is wrong. -- Jakub

On Tue, Apr 29, 2014 at 09:15:18PM +0200, Jakub Arnold wrote:
in my stumbling over Reddit I happened to find the following comment http://www.reddit.com/r/programming/comments/248abo/range_comprehensions_c/c..., where the poster shows a simple algorithm which is really slow when implemented in Haskell, compared to a C++ counterpart which does it the same way.
I have done my duty.
participants (2)
-
Jakub Arnold
-
Tom Ellis