title: How to code a case block in Haskell that works with Int and Char
body: <p>I'm working on some Haskell code and stumbled upon a problem. Basically I'm coding a case of block to check the input given by the user that checks if the input is any of the accepted chars as well as Ints</p>
  
  <p>I've tried coding another case block after the first one, but I couldn't work that out. I've tried to code an if-else block that checks if the input is int even before the case block, but that also failed</p>
  
  <p>This is the block of code taken from the middle of the function:</p>
  
  <pre><code>if player == 1 then
             do newline
                putStr "Nim: r a / ? / q &gt; "
                inp &lt;- getLine
                let inputs = words inp
                    h = head inputs
                case h of
                   "q" -&gt; do
                      play
                   "?" -&gt; do
                      putStrLn "r is the row and a is amount to remove"
                      putStrLn "The person to remove the last piece wins"
                      play board player
  
                   -- The case below is the one that I can't seem to make work
                   -- Wrote Int -&gt; do now just to make it clear what I'm looking to do 
                   Int -&gt; do
                      let row = (read(inputs !! 0) :: Int)
                      let row = (read(inputs !! 1) :: Int)
                      if valid board row num then
                         play (move board row num) (next player)
                      else
                         do newline
                            putStrLn "ERROR: Invalid move"
                            play board player
  
  </code></pre>
  
  <p>Expected scenarios:</p>
  
  <pre><code>Nim: r a / ? / q &gt; q
  &gt;&gt; "quits game"
  
  Nim: r a / ? / q &gt; ?
  &gt;&gt; r is the row and a is amount to remove
  &gt;&gt; etc etc...
  
  Nim: r a / ? / q &gt; 2 2
  &gt;&gt; "Perform move 2 2"
  
  </code></pre>
  
  <p>The first two scenarios work. My only problem is to integrate a way to check if the inputs are integers in the case block.</p>
  
  <p>Any help is appreciated</p>