Hi folks,



I am trying to use the withFile function of System.IO, but it always return an empty string when testing.

Could someone explain why:

main= do
              h<-openFile "test.cir" ReadMode
              c<-hGetContents h
              print c

> runhaskell test1.hs
> "* Teste\n\nR1  1 0 10\nC1  1 0 10uF\nI1  1 0 1mA\n\n.DC \n.PRINT\n"

works and


main= (withFile "test.cir" ReadMode hGetContents) >>= print

> runhaskell test1.hs
> ""

don't?


Thanks!
--
Rafael Gustavo da Cunha Pereira Pinto
Electronic Engineer, MSc.