title: Convert string of digits to integer
body: <p>I am trying to write this function in Haskell called atoi, which takes a string of digits representing an integer to the integer itself.</p>
  
  <p>For example, <code>atoi "123"</code> should give 123.</p>
  
  <p>Here's my implementation so far:</p>
  
  <pre><code>atoi :: String -&gt; Int
  atoi str = show str :: Int
  </code></pre>
  
  <p>I got an error stating</p>
  
  <blockquote>
    <p>Couldn't match type</p>
  </blockquote>