title: How to check type in haskell
body: <p>I don't know how to check type of variable in haskell, Here i mean , when i read something from console with <code>getLine</code> ,however i expect it to be an interger but user can enter a string also,then i don't want my program to crash. For example if someone inputs a string and i try to convert it to <code>Int</code> then it will crash(exception) so i want to check whether it is convertable or not. How do i do that ? Thanks for any help :)</p>
  
  <pre><code> main1 = do
          let g &lt;- getLine
              k = g :: Int 
              if(k :: Int)
                  then ........ 
  </code></pre>