I haven't had a chance to test anything, but list operations are frequently problematic because they make it easy to accidentally write O(n^2) algorithms. Have you tried using Sequences or Vectors? I would expect one of them to give you better performance for your access patterns.

On Thursday, September 24, 2015, Daniel Trstenjak <daniel.trstenjak@gmail.com> wrote:

Hi Mario,

I just took a quick look on the implementation of 'dur'
and as a first thing I would replace foldl with
the strict version foldl'.

This already might explain the memory usage.

Greetings,
Daniel
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners