On Sunday, December 22, 2002, at 04:00 AM, 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
Jyrinx wrote:
[...] and
the inability to handle exceptions (the actual exception won't occur
until after e.g. getContents has returned).
But how does this differ from strict I/O? I mean, say there's a disk
error in the middle of some big file I want to crunch. Under traditional
I/O,
Glynn Clements wrote:
Jyrinx wrote:
[...] and
the inability to handle exceptions (the actual exception won't occur
until after e.g. getContents has returned).
But how does this differ from strict I/O? I mean, say there's a disk
error in the middle of some big file I want to crunch.
On Mon, Dec 23, 2002 at 09:05:00AM +, Glynn Clements wrote:
Jyrinx wrote:
So is this lazy-stream-via-unsafeInterleaveIO not so nasty, then, so
long as a few precautions (not reading too far into the stream,
accounting for buffering, etc.) are taken? I like the idiom Hudak uses
On Mon, Dec 23, 2002 at 09:05:00AM +, Glynn Clements wrote:
The main problems with lazy I/O are the lack of control over ordering
(e.g. you can't delete the file until a stream has been closed, but
you may not be able to control how long the stream remains open), and
the inability to
Jyrinx wrote:
So is this lazy-stream-via-unsafeInterleaveIO not so nasty, then, so
long as a few precautions (not reading too far into the stream,
accounting for buffering, etc.) are taken? I like the idiom Hudak uses
(passing a stream of I/O results to the purely functional part of the
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]
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
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
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
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
11 matches
Mail list logo