title: hGetContents being too lazy
body: <p>I have the following snippet of code, which I pass to <code>withFile</code>:</p>
  
  <pre><code>text &lt;- hGetContents hand 
  let code = parseCode text
  return code
  </code></pre>
  
  <p>Here hand is a valid file handle, opened with <code>ReadMode</code> and <code>parseCode</code> is my own function that reads the input and returns a Maybe.  As it is, the function fails and returns Nothing. If, instead I write:</p>
  
  <pre><code>text &lt;- hGetContents hand 
  putStrLn text
  let code = parseCode text
  return code
  </code></pre>
  
  <p>I get a Just, as I should.  </p>
  
  <p>If I do <code>openFile</code> and <code>hClose</code> myself, I have the same problem. Why is this happening? How can I cleanly solve it?  </p>
  
  <p>Thanks</p>