Lazy streams and unsafeInterleaveIO

2002-12-22 Thread Jyrinx
As an experiment for a bigger project, I cooked up a simple program: It asks for integers interactively, and after each input, it spits out the running total. The wrinkle is that the function for calculating the total should be a non-monadic stream function (that is, type [Integer] - [Integer]

Re: Interpret haskell within haskell.

2002-12-22 Thread Lauri Alanko
On Fri, Dec 20, 2002 at 01:43:07PM +0100, Frank Atanassow wrote: There is quite a bit of work on staged evalution, metaprogramming, quasiquotation, reflection and run-time code generation in typed and ML-like languages. It's a very active and, IMO, promising area of research. Yes. Thanks for

Re: Lazy streams and unsafeInterleaveIO

2002-12-22 Thread Remi Turk
On Sun, Dec 22, 2002 at 04:00:45AM -0800, Jyrinx wrote: As an experiment for a bigger project, I cooked up a simple program: It asks for integers interactively, and after each input, it spits out the running total. The wrinkle is that the function for calculating the total should be a

Re: Lazy streams and unsafeInterleaveIO

2002-12-22 Thread Jyrinx
Remi Turk wrote: On Sun, Dec 22, 2002 at 04:00:45AM -0800, Jyrinx wrote: As an experiment for a bigger project, I cooked up a simple program: It asks for integers interactively, and after each input, it spits out the running total. The wrinkle is that the function for calculating the total

Re: Lazy streams and unsafeInterleaveIO

2002-12-22 Thread Hal Daume III
BTW, I already found a major problem with the code I attached earlier, using unsafeInterleaveIO: Run in GHCi (as I had done), it works fine; but compiled by GHC and run as an executable, it waits for input and *then* displays the prompt after the user hits Enter ... not very helpful. I

Re: Lazy streams and unsafeInterleaveIO

2002-12-22 Thread Jyrinx
Hal Daume III wrote: BTW, I already found a major problem with the code I attached earlier, using unsafeInterleaveIO: Run in GHCi (as I had done), it works fine; but compiled by GHC and run as an executable, it waits for input and *then* displays the prompt after the user hits Enter ... not