Detect arithmetic underflow with unsigned integers

Run Settings
LanguageHaskell
Language Version
Run Command
module Main ( main ) where sub :: Word -> Word -> Maybe Word sub a b | a >= b = Just (a - b) | otherwise = Nothing main :: IO () main = do print $ sub 2 1 print $ sub 1 2
Editor Settings
Theme
Key bindings
Full width
Lines