
On 9 November 2011 03:26, Jason Dagit
On Tue, Nov 8, 2011 at 7:02 PM, Ian Lynagh
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. Duncan