title: HASKELL *** Exception: Prelude.read: no parse (possible duplicate)
body: <p>I have this code</p>
  <pre><code>import Data.Char (isDigit)
  
  eval :: [Int] -&gt; IO()
  eval liste = do
      putStrLn &quot;Please enter a positive integer or an operater ( + / - / * ): &quot;
      input &lt;- getLine
      let
          ord = words input
          cmd = read (head ord) :: Char
          in
              if isDigit cmd then
                  let nyliste = (read [cmd] :: Int) : liste in do
                  print nyliste
                  eval nyliste
              else if isOperator cmd then if null liste || length liste == 1 then do
                      putStrLn &quot;Invalid input! Start by adding at least two positive integers&quot;
                      eval liste
                  else let
                      fst = head liste
                      snd = head $ tail liste
                      in case cmd of
                          '+' -&gt; let
                              newValue = fst + snd
                              oppliste = newValue : drop 2 liste
                              in do
                                  print oppliste
                                  eval oppliste
                          '-' -&gt; let
                              newValue = fst - snd
                              oppliste = newValue : drop 2 liste
                              in do
                                  print oppliste
                                  eval oppliste
                          '*' -&gt; let
                              newValue = fst * snd
                              oppliste = newValue : drop 2 liste
                              in do
                                  print oppliste
                                  eval oppliste
                          _ -&gt; do
                              putStrLn &quot;Invalid input! Start by adding at least two positive integers&quot;
                              eval liste
              else do
                  putStrLn &quot;Invalid input! Start by adding at least two positive integers&quot;
                  eval liste
  
  
  isOperator :: Char -&gt; Bool
  isOperator c = c == '*' || c == '+' || c == '-'
  
  main :: IO()
  main = eval []
  </code></pre>
  <p>Which, when I try to run it, it gives me this error:</p>
  <pre><code>[1 of 1] Compiling Main             ( test.hs, interpreted )
  Ok, one module loaded.
  ghci&gt; main
  Please enter a positive integer or an operater ( + / - / * ):
  1
  *** Exception: Prelude.read: no parse
  ghci&gt;
  </code></pre>
  <p>I have looked at similar questions, and I understand that the error has something to do with my use of <code>read</code>, but I don't understand much more than that. What am I doing wrong here?</p>