'while' loop on mutable arrays causes stack overflow

Gunnar Kedenburg gunnar at haquebright.de
Thu Apr 20 11:34:33 EDT 2006

Hello Bulat,

Bulat Ziganshin wrote:
> it seems that you just construct huge unevaluated thunk. making things
> stricter is a whole art, in this case try the following:
> [...]

Thanks a lot, it works now. I believed that writeSTRef would always
evaluate its arguments because ST is strict, but apparently I was
mistaken :)

> i recommend you to use your `for` instead of your `while` - it's a much faster
> and straightforward

I agree.


More information about the Glasgow-haskell-users mailing list