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.
maybe_divide :: Maybe Integer -> Maybe Integer -> Maybe Integer
maybe_divide a b = case valid_div a b of
True -> Just (a `div` b)
False -> Nothing
valid_div :: Maybe Integer -> Maybe Integer -> Bool
valid_div a b
| a == Nothing = False
| b == Nothing = False
| b == Just 0 = False
| otherwise = True
Any help would be appreciated. Thanks