Hi folks,<br><br><br><br>I am trying to use the withFile function of System.IO, but it always return an empty string when testing.<br><br>Could someone explain why:<br><br>main= do <br> h<-openFile "test.cir" ReadMode<br>
c<-hGetContents h<br> print c<br><br>> runhaskell test1.hs<br>> "* Teste\n\nR1 1 0 10\nC1 1 0 10uF\nI1 1 0 1mA\n\n.DC \n.PRINT\n"<br><br>works and <br><br><br>
main= (withFile "test.cir" ReadMode hGetContents) >>= print<br><br>
> runhaskell test1.hs<br>
> ""<br>
<br>don't?<br><br><br clear="all">Thanks!<br>-- <br>Rafael Gustavo da Cunha Pereira Pinto<br>Electronic Engineer, MSc.<br>