I'm still a beginner in Haskell.
My code
secureDivide :: Int -> Int -> Maybe Int
secureDivide _ 0 = Nothing
secureDivide 0 _ = Nothing
secureDivide x y = Just (x `div` y)
addOne:: Maybe Int -> Maybe Int
addOne (Just n) = Just (n + 1)
Actually I don't have any problem and get the result I want with 'secureDivide'.
Example : secureDivide 10 0 -> Nothing
But when I try something like this :
mySecureNext (mySecureDiv 10 0) -> I have an 'Exception' and not 'Nothing'
Is there a way to handle an error to a message without import something with the if-else statement like if error = Nothing else Just ... (or other option) ?