title: Haskell - Validate integer input from string using readMaybe
body: <p>I am trying to validate integer input from a string, I just need a boolean result if the input string correctly changes types to an integer. I tried this method from another question:</p>
  
  <p><a href="https://stackoverflow.com/a/30030649/3339668">https://stackoverflow.com/a/30030649/3339668</a></p>
  
  <p>This is the relevant code along with my imports:</p>
  
  <pre><code>import Data.Char
  import Data.List
  import Text.Read
  
  checkValidInt :: String -&gt; Bool
  checkValidInt strInt
   | readMaybe strInt :: Maybe Int == Nothing = False
   | readMaybe strInt :: Maybe Int /= Nothing = True
  </code></pre>
  
  <p>However, I receive the following errors on loading the script:</p>
  
  <pre><code>Illegal operator ‘==’ in type ‘Maybe Int == Nothing’
  Use TypeOperators to allow operators in types
  
  main.hs:350:38:
  Not in scope: type constructor or class ‘Nothing’
  A data constructor of that name is in scope; did you mean DataKinds?
  
  main.hs:351:35:
  Illegal operator ‘/=’ in type ‘Maybe Int /= Nothing’
    Use TypeOperators to allow operators in types
  
  main.hs:351:38:
  Not in scope: type constructor or class ‘Nothing’
  A data constructor of that name is in scope; did you mean DataKinds?
  </code></pre>
  
  <p>So what kind of data type is Nothing? How do I check if Nothing is the result of readMaybe properly?</p>
  
  <p>Thanks.</p>