title: Converting Char to Int in haskell
body: <p>I am trying to convert a string (of numbers) into individual digits. There are multiple ways to solve this, one being to <code>map digitToInt "1234"</code></p>
  
  <p>I was trying a similar approach but instead of using <code>digitToInt</code>, I was trying to use the <code>read::Char-&gt;Int</code> function. However I am getting compilation error when I use the above, as in:</p>
  
  <pre><code>map (read::Char-&gt;Int) ['1','2']
  </code></pre>
  
  <p>gives me the following error given below. I am not sure what is wrong here, I am trying to map a function which takes Char over a list of Char, what am I missing?</p>
  
  <p>Please do not tell me of alternate approach as I understand there are several other ways to do this. Just want to understand what is happening here.</p>
  
  <pre><code>Couldn't match type ‘Char’ with ‘[Char]’
        Expected type: Char -&gt; Int
          Actual type: String -&gt; Int
      • In the first argument of ‘map’, namely ‘(read :: Char -&gt; Int)’
  </code></pre>