{- A multiline comment which can continue for many lines -} data Expr = Val Int | Div Expr Expr -- data Maybe a = Nothing | Just a eval :: Expr -> Maybe Int eval (Val n) = Just n eval (Div x y) = case (eval x) of Nothing -> Nothing Just n -> case eval y of Nothing -> Nothing Just m -> safediv m n safediv :: Int -> Int -> Maybe Int safediv n m = if m == 0 then Nothing else Just (n `div` m)