re-opening a closed stdin?

Simon Marlow simonmar@microsoft.com
Mon, 25 Nov 2002 10:09:01 -0000


> "Simon Marlow" <simonmar@microsoft.com> writes:
>=20
> > One reason, I think, is lazy I/O(*).  It's to stop you accidentally
>=20
> [...]
>=20
> > (*) kill it! die! die!
>=20
> So you want
>   main =3D readFile "/dev/zero" >> return ()
> to terminate violantly rather than terminate peacefully? :)
>=20
> Seriously, I understand that the IO monad is the most intuitive and
> robust when it is strict.  But sometimes it is also nice if one could
> map a file to a lazy string.

It is nice, but it introduces too many problems.  What happens to any
I/O errors encountered by the lazy I/O?  They have to be discarded,
which means you can't effectively use lazy I/O for robust applications
anyway.

Cheers,
	Simon