[Haskell-cafe] A Monad for on-demand file generation?

Joachim Breitner mail at joachim-breitner.de
Tue Jul 1 06:22:35 EDT 2008


Am Dienstag, den 01.07.2008, 11:53 +0200 schrieb Ketil Malde:
> Joachim Breitner <mail at joachim-breitner.de> writes:
> >> 1) unsafeInterleaveIO seems like a big hammer to use for this problem,
> >> and there are a lot of gotchas involved that you may not have fully
> >> thought out.  But you do meet the main criteria (file being read is
> >> assumed to be constant for a single run of the program).
> > Any other gotcha? 
> The one that springs to mind is that you might run out of file
> handles. At least on Linux, that's a precious resource.

but at least then, (unsafeInterleaveIO readFile) is actually better than
(readFile), because if I consume the files in sequence and complete,
they will be opened and closed in sequence with the first one, but be
opened all at once with the second. At least it won’t be worse, because
the file will not be closed later, and possibly opened later.


Joachim "nomeata" Breitner
  mail: mail at joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C
  JID: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/
  Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20080701/195b2dac/attachment.bin

More information about the Haskell-Cafe mailing list