[Haskell-cafe] Re: Strictness, order of IO operations: NewCGI & HDBC

Greg Fitzgerald garious at gmail.com
Fri Oct 20 16:30:26 EDT 2006

> An ugly solution is to explicitly keep a
> pointer to the next unevaluated entry, advancing it in the interleaved
> IO operation. A leaky solution is to keep a reference to the list, and
> force it all.

Another way to attack this is asking: Why doesn't the simple solution work?
That is, not using unsafeInterleaveIO.

It seems like any problem caused by not using unsafeInterleaveIO is
fundamentally because the IO monad encapsulates orthogonal regions.  Why
can't I interleave fetching rows from the DB with writing each row to the
console?  Sure, it is *possible* that writing to the console is piped back
into the same database, but if not, you're serializing things that don't
need to be serialized.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20061020/54df5fc3/attachment.htm

More information about the Haskell-Cafe mailing list