shithub: MicroHs

Download patch

ref: ac32433bdf0e873146e629eb5d126b1798c6bfc8
parent: 778c3e3e51bbc33f13181d7ffd3b1aed1b30fcb9
author: Lennart Augustsson <lennart@augustsson.net>
date: Wed Apr 3 05:16:13 EDT 2024

Add ArithException

--- a/lib/Control/Exception.hs
+++ b/lib/Control/Exception.hs
@@ -15,6 +15,8 @@
   throwIO,
 --  onException,
   displaySomeException,
+  --
+  ArithException(..),
   ) where
 import Control.Exception.Internal
 import {-# SOURCE #-} Data.Typeable
@@ -119,3 +121,15 @@
 -- XXX we don't have masks yet
 mask :: ((forall a. IO a -> IO a) -> IO b) -> IO b
 mask io = io id
+
+-------------------
+
+data ArithException
+  = Overflow
+  | Underflow
+  | LossOfPrecision
+  | DivideByZero
+  | Denormal
+  | RatioZeroDenominator
+  deriving (Eq, Ord, Show, Typeable)
+instance Exception ArithException
--