[Haskell-cafe] Resources/papers on lazy I/O

Vanessa McHale vanessa.mchale at iohk.io
Thu Mar 28 18:26:22 UTC 2019


Hi all,

I recently finished up writing streaming facilities via libarchive
bindings and lazy bytestrings. It ended up working nicely - reading from
a file lazily and then unpacking the archive was more efficient in time
+ allocations than reading the file all at once.

That got me thinking - what exactly is wrong with lazy I/O? I've seen
Oleg Kiselyov's paper (http://okmij.org/ftp/Haskell/#lazyIO-not-True)
and I've run into issues myself (basically the issue here:
https://stackoverflow.com/questions/31342012/read-and-writing-to-file-in-haskell),
but none of those seem so pathological - the second issue could be
better resolved with linear types!

Are the any explanations of why Haskell *does* use lazy I/O? Laziness
allows symmetries between values and generators of values - surely it is
not *that* immoral to enforce this even in the IO monad?

Cheers,
Vanessa McHale

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20190328/348b3a6d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20190328/348b3a6d/attachment.sig>


More information about the Haskell-Cafe mailing list