getContents

George Russell ger@Informatik.Uni-Bremen.DE
Thu, 26 Oct 2000 12:20:52 +0200


I don't really understand getContents.  (Does anyone?)  I have some code here
(far too large to submit).  If I do (on Linux, ghc4.08.1, both with and without optimisation)
------------------      
      contents <- hGetContents handle
      seq (last contents) (hClose handle)
------------------
the code works.  However I looked at the manual and it seems that hClose should
force the whole of contents to be read anyway.  So I changed it to
------------------
      contents <- hGetContents handle
      hClose handle
------------------
and then the code doesn't work.  If these are meant to be the same, then we have a GHC
bug.  If not, could someone explain in words of one syllable why not?

PS - if you want the source code you'll have to download and compile the whole of UniForM!!