Re: A: Evaluation order, ghc versus hugs, lazy vs. strict

2002-08-28 Thread Phil Trinder
Dear All, Hal's comments on the use of Evaluation Strategies for controlling strictness are substantially right, and they are used this way in Eden, a parallel Haskell. In Glasgow parallel Haskell(GpH) we use them to control parallel evaluation as well. The key reference is Algorithm +

Re: Evaluation order, ghc versus hugs, lazy vs. strict

2002-08-21 Thread Dylan Thurston
On Tue, Aug 20, 2002 at 10:43:39AM +0200, Jan Kybic wrote: This is what I cannot do for the moment. How do I find out what is really going on. Any pointers to a relevant articles/literature? ... In addition to the other suggestions, see Chapter 6 (Advice on: sooner, faster, smaller,

Re: Evaluation order, ghc versus hugs, lazy vs. strict

2002-08-21 Thread Malcolm Wallace
Alastair Reid [EMAIL PROTECTED] writes: http://www.cs.york.ac.uk/fp/profile.html [York don't seem to put links to their pages on the web. Citeseer may have some of them.] Thanks for pointing this out. I've now added lots of links for papers on that webpage. Regards,

Re: Evaluation order, ghc versus hugs, lazy vs. strict

2002-08-20 Thread Jan Kybic
As you've apparently discovered, the trick is to be lazy but not too lazy. That is, you want to generate the list lazily but compute a partial result (i.e., the running total of that part of the list processed so far) strictly. Thanks for all reactions. Now my simplified examples indeed run in

Re: Evaluation order, ghc versus hugs, lazy vs. strict

2002-08-19 Thread Alastair Reid
main = print $ sum [0..100] When you use a sufficiently large number (perhaps 1000 instead of 100), both ghci and ghc terminate with Stack space overflow. On the other hand, Hugs (dated December 2001) runs the example OK and produces the result of 5050. I have the

Re: Evaluation order, ghc versus hugs, lazy vs. strict

2002-08-19 Thread Dylan Thurston
On Mon, Aug 19, 2002 at 11:19:41PM +0200, Jan Kybic wrote: Hello, I am wrestling with having Haskell (using ghc(i) version 5.02.2) evaluate things in good order and to garbage collect what he no longer needs. I could simplify the problem to this simple example: main = print $ sum

Re: Evaluation order, ghc versus hugs, lazy vs. strict

2002-08-19 Thread Dylan Thurston
On Mon, Aug 19, 2002 at 11:34:48PM +0100, Alastair Reid wrote: main = print $ sum [0..100] ... Hugs uses foldl' instead of foldl to define sum:... Does it really? That's a violation of the standard: a user's instance of (+) need not be strict in its left argument. Consider data Foo