title: Haskell Couldn't match expected type involving maybe
body: <p>I am currently learning Haskell and I have run into a problem but I don't really understand what is the problem. When I compile the code below, it tells me "Couldnt match expected type 'integer' with actual type 'Maybe Integer'" for line 17:19 and again the same error for 17:27.</p>
  
  <pre><code>maybe_divide :: Maybe Integer -&gt; Maybe Integer -&gt; Maybe Integer
  maybe_divide a b = case valid_div a b of
  True  -&gt; Just (a `div` b)
  False -&gt; Nothing
  
  valid_div :: Maybe Integer -&gt; Maybe Integer -&gt; Bool
  valid_div a b
      | a == Nothing = False
      | b == Nothing = False
      | b == Just 0  = False
      | otherwise = True
  </code></pre>
  
  <p>Any help would be appreciated. Thanks</p>