I a fresh man in Haskell. Here is my program :
maybe_divide :: Maybe Integer -> Maybe Integer -> Maybe Integer
maybe_divide a b = case (a, b) of
(Just a, Just b)
| (Just a, Just b)
| (Nothing, _) -> Nothing
| (_, Just 0) -> Nothing
| (_, Nothing) -> Nothing
| (Just a,Just b) -> Just (a `div` b)
The compiler shows that: pattern syntax in expression context:_. When I just use case without guards it works. Why it doesn't work within guards?