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)


上一篇:
下一篇:
切换中文