Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Haskell IO for Imperative Programmers. Parent comment
If you write
do h <- openFile "foo.txt" ReadMode x <- hGetContents h putStr x
do h <- openFile "foo.txt" ReadMode x <- hGetContents h hClose h putStr x
There are no comments on this comment yet.
If you write
you'll get different behavior than if you write In the first example, you'll print out the contents of the file. In the latter, you'll print out nothing.