[Haskell-cafe] Re: How do I get a long iteration to run in constant space

2004-10-06 Thread W M
I take it that the extra case always fails but forces the arguments to be evaluated? Nice trick. Thanks! --wgm --- [EMAIL PROTECTED] wrote: > > I added two lines to your code: > > iterate2 f x n | seq f $ seq x $ seq n $ False = > undefined > iterate2 f x n = --- as before > > rk4Next f h (

[Haskell-cafe] How do I get a long iteration to run in constant space

2004-10-04 Thread W M
Hi, I'm starting to learn haskell, and I was considering it for a simulation I've been designing, but I ran into this problem with a simple numerical calculation. The attached program is supposed to solve a stiff differential equation, and you have to use a very small stepsize and lots of steps to