frege
module ExceptionHandling where
import Control.Exception (Exception, throw)
data DivisorIsZero = DivisorIsZero deriving Exception
divide :: Double -> Double -> Either DivisorIsZero Double
divide _ 0 = throw DivisorIsZero
divide x y = Right (x / y)