closing file handles

Julian Seward (Intl Vendor) [email protected]
Mon, 10 Sep 2001 02:06:16 -0700


| I'm sorry, I had a small error in my code.  It should have been:
|=20
| >go filelist =3D mapM go' filelist          -- no "do return"
| >    where go' f =3D do h <- openFile f ReadMode
| >                     text <- hGetContents h
| >                     let c =3D head $! text
| >                     return (c `seq` (hClose h `seq` c))

I don't think the "do return" bit matters.

If you change the last line to

    c `seq` (hClose h `seq` return c)

is the behaviour changed?

J