Define nonTermination for the RTS to use
authorIan Lynagh <igloo@earth.li>
Sat, 21 Jun 2008 14:44:20 +0000 (14:44 +0000)
committerIan Lynagh <igloo@earth.li>
Sat, 21 Jun 2008 14:44:20 +0000 (14:44 +0000)
We'll probably need to do the same for some other exceptions too

GHC/Exception.lhs-boot
GHC/IOBase.lhs

index 773e4a5..dfd8013 100644 (file)
@@ -8,8 +8,12 @@ import {-# SOURCE #-} qualified GHC.IOBase as IOB
 
 class Exception e
 
+data SomeException
+
 instance Exception IOB.Exception
 
 throwIO :: Exception e => e -> IOB.IO a
+
+toException :: Exception e => e -> SomeException
 \end{code}
 
index 053cfd8..378237d 100644 (file)
@@ -43,7 +43,9 @@ module GHC.IOBase(
     Exception(..), ArithException(..), AsyncException(..), ArrayException(..),
     stackOverflow, heapOverflow, ioException, 
     IOError, IOException(..), IOErrorType(..), ioError, userError,
-    ExitCode(..) 
+    ExitCode(..),
+    -- The RTS calls this
+    nonTermination,
   ) where
 
 import GHC.ST
@@ -57,7 +59,7 @@ import GHC.Show
 import GHC.List
 import GHC.Read
 import Foreign.C.Types (CInt)
-import {-# SOURCE #-} GHC.Exception ( throwIO )
+import {-# SOURCE #-} GHC.Exception ( SomeException, toException, throwIO )
 
 #ifndef __HADDOCK__
 import {-# SOURCE #-} Data.Typeable     ( showsTypeRep )
@@ -712,6 +714,9 @@ data Exception
         -- 'String' argument gives the location of the
         -- record update in the source program.
 
+nonTermination :: SomeException
+nonTermination = toException NonTermination
+
 -- |The type of arithmetic exceptions
 data ArithException
   = Overflow