title: Works in GHCi> but not when loaded?
body: <p>I cant figure out why I get two different results but I'm sure it has to do with <code>IO</code>, which I am beginning to hate!</p>
  
  <p>For example:</p>
  
  <pre><code>  ghci&gt; x &lt;- readFile "foo.txt"
    ghci&gt; let y = read x :: [Int]
    ghci&gt; :t y
    y :: [Int]
  </code></pre>
  
  <p>Now when I create that file and do the same thing it comes out as <code>IO [Int]</code> ?</p>
  
  <p><code>foo.txt</code> is a txt file containing only this: <code>12345</code></p>
  
  <p>Someone that can explain this to me? As I'm about to snap it!</p>
  
  <p>Thanks for any insight!</p>