Re: lazy Printing question

2003-07-25 Thread AJ
On Monday 21 Jul 2003 7:21 pm, Alastair Reid wrote: If I try to run the program (compiled using GHC 6), it calculates all members of the list and then prints the whole list in the end. Since Haskell is 'lazy' I was expecting behaviour similar to HUGS where it prints the numbers as it finds

Re: lazy Printing question

2003-07-25 Thread Glynn Clements
AJ wrote: Ok so I added the hSetBuffering stdout NoBuffering line to my main function and still got the same 'nonlazy' behaviour, or so I thought. It took me some time to figure out what was going on. I am using emacs to write my code and I was calling a.out from inside it. Obviously it

Re: lazy Printing question

2003-07-25 Thread AJ
On Friday 25 Jul 2003 6:52 pm, you wrote: AJ wrote: Ok so I added the hSetBuffering stdout NoBuffering line to my main function and still got the same 'nonlazy' behaviour, or so I thought. It took me some time to figure out what was going on. I am using emacs to write my code and I was

lazy Printing question

2003-07-21 Thread AJ
Hi everyone, I have written the following program to find magic numbers i.e. integers 'n' such that both (n+1) and (n/2+1) are perfect squares. -- Program to find magic numbers Import IO main :: IO () main = do print (filter magicP sqs) sqs :: [Int] sqs = [x*x | x -

Re: lazy Printing question

2003-07-21 Thread Alastair Reid
If I try to run the program (compiled using GHC 6), it calculates all members of the list and then prints the whole list in the end. Since Haskell is 'lazy' I was expecting behaviour similar to HUGS where it prints the numbers as it finds them. Does this behaviour have something to do with