[Haskell-cafe] How do I avoid stack overflows?

2007-03-15 Thread DavidA
Hi. I'm trying to write some code which involves lots of matrix multiplications, but whenever I do too many, I get stack overflows (in both GHCi 6.4.2, and Hugs May 2006). The following code exhibits the problem. import List (transpose) u . v = sum $ zipWith (*) u v a * b = multMx a

Re: [Haskell-cafe] How do I avoid stack overflows?

2007-03-15 Thread Claus Reinke
I'm trying to write some code which involves lots of matrix multiplications, but whenever I do too many, I get stack overflows (in both GHCi 6.4.2, and Hugs May 2006). The following code exhibits the problem. .. I tried to fix the problem using seq, as follows: iterate' f x = x : seq x'

[Haskell-cafe] How do I avoid stack overflows?

2007-03-15 Thread oleg
DavidA wrote: I'm trying to write some code which involves lots of matrix multiplications, but whenever I do too many, I get stack overflows (in both GHCi 6.4.2, and Hugs May 2006). By placing a couple of strictness annotations, your test' gives the expected answer (given some time) on Hugs.