Re: [Haskell-cafe] Strange behaviour with writeFile

2007-02-04 Thread Neil Davies
Its about the lazyness of reading the file. The handles on the file associated (underlying readFile) is still open - hence the resource being in use. When you add that extra line the act of writing out the remainer causes the rest of the input to be fully evaluated and hence the filehandle is

Re: [Haskell-cafe] Strange behaviour with writeFile

2007-02-04 Thread C.M.Brown
Hi Neil, When you add that extra line the act of writing out the remainer causes the rest of the input to be fully evaluated and hence the filehandle is closed. Ah, yes of course :) I've found that: let (answer2, remainder) = parseAnswer (force answer) where force :: Eq a = a - a force x

Re: [Haskell-cafe] Strange behaviour with writeFile

2007-02-04 Thread Donald Bruce Stewart
cmb21: fo/haskell-cafe, mailto:[EMAIL PROTECTED] Errors-To: [EMAIL PROTECTED] Status: O Content-Length: 778 Lines: 27 Hi, I am observing some rather strange behaviour with writeFile. Say I have the following code: answer - AbstractIO.readFile filename let (answer2,