> 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.

Thanks,
Greg

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to