Hello,
I wrote a simple test program as
main = do
withFile "a.txt" ReadMode (\h -> do
c <- hGetContents h
putStrLn c)
then I got my expected results: I'm a.txt
but if I changed to
main = do
c <- withFile "a.txt" ReadMode hGetContents
putStrLn c
I got just a empty line.
Where am I wrong?
Thanks.