Removing lazy IO? (Was: Re: Proposal: Stop enforcing single-writer-multi-reader file access)
lemming at henning-thielemann.de
Wed Nov 9 12:28:56 CET 2011
On Wed, 9 Nov 2011, Ivan Lazar Miljenovic wrote:
> On 9 November 2011 14:26, Jason Dagit <dagitj at gmail.com> wrote:
>> The other separate proposal that I would like to propose (at some time
>> in the future) is a thorough removal of "lazy IO" from base. Or at
>> least make it not available in the Prelude (ie., people have to ask
>> for it if they want it). Perhaps this would require the support of
> Is this really necessary/desirable? I for one have made use of lazy
> I/O (though admittedly I typically do so now via lazy ByteString/Text
> values rather than String-based I/O).
The behaviour is sometimes unexpected, e.g. in
writeFile path . process =<< readFile path
Further on it is hard to handle exceptions that occur during 'readFile'
(getContents and so). Some time ago, I wrote the LazyIO monad that could
encapsulate lazy I/O and thus may make it a bit safer.
More information about the Libraries