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
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'
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.