From: Ian Lynagh Date: Sat, 21 Jun 2008 14:44:20 +0000 (+0000) Subject: Define nonTermination for the RTS to use X-Git-Tag: 6_10_branch_has_been_forked~124 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=5d62e47ff57e1f2563ea73fc5614cd6d7aacabaa;p=ghc-base.git Define nonTermination for the RTS to use We'll probably need to do the same for some other exceptions too --- diff --git a/GHC/Exception.lhs-boot b/GHC/Exception.lhs-boot index 773e4a5..dfd8013 100644 --- a/GHC/Exception.lhs-boot +++ b/GHC/Exception.lhs-boot @@ -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} diff --git a/GHC/IOBase.lhs b/GHC/IOBase.lhs index 053cfd8..378237d 100644 --- a/GHC/IOBase.lhs +++ b/GHC/IOBase.lhs @@ -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