Removing lazy IO? (Was: Re: Proposal: Stop enforcing single-writer-multi-reader file access)

Duncan Coutts duncan.coutts at
Wed Nov 9 12:54:07 CET 2011

On 9 November 2011 03:26, Jason Dagit <dagitj at> wrote:
> On Tue, Nov 8, 2011 at 7:02 PM, Ian Lynagh <igloo at> wrote:
>> On Tue, Nov 08, 2011 at 01:07:23PM +0000, Duncan Coutts wrote:
>>> We should take the same approach with openFile. Currently we have:
>>> openFile :: FilePath -> IOMode -> IO Handle
>>> I suggest changing the IOMode for a record of options which would
>>> include the IO mode (read/write/read-write/etc), and other things like
>>> file locking, default create permissions, create exclusive etc. Again,
>>> we'd use a default value and override extra options as necessary.
>> I've just reread the thread, and I think the best way forwards would be
>> to make the original proposed change now, and for the above change to be
>> proposed separately.
> 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
> Haskell'?

Note that the issue of locking and the issue of lazy IO are mostly
orthogonal. We still want locking to prevent accidental cases of
concurrent reading and writing even if you're not using lazy IO.


More information about the Libraries mailing list