Don't use ^(2::Int) in Data.Complex.magnitude; partially fixes trac #2450
[ghc-base.git] / GHC / IOBase.lhs
index 9b4b0be..c15d6c7 100644 (file)
@@ -47,7 +47,8 @@ module GHC.IOBase(
     throwIO, block, unblock, blocked, catchAny, catchException,
     evaluate,
     ErrorCall(..), AssertionFailed(..), assertError, untangle,
-    BlockedOnDeadMVar(..), BlockedIndefinitely(..), Deadlock(..)
+    BlockedOnDeadMVar(..), BlockedIndefinitely(..), Deadlock(..),
+    blockedOnDeadMVar, blockedIndefinitely
   ) where
 
 import GHC.ST
@@ -65,7 +66,6 @@ import GHC.Exception
 
 #ifndef __HADDOCK__
 import {-# SOURCE #-} Data.Typeable     ( Typeable )
-import {-# SOURCE #-} Data.Dynamic      ( Dynamic )
 #endif
 
 -- ---------------------------------------------------------------------------
@@ -642,6 +642,9 @@ instance Exception BlockedOnDeadMVar
 instance Show BlockedOnDeadMVar where
     showsPrec _ BlockedOnDeadMVar = showString "thread blocked indefinitely"
 
+blockedOnDeadMVar :: SomeException -- for the RTS
+blockedOnDeadMVar = toException BlockedOnDeadMVar
+
 -----
 
 data BlockedIndefinitely = BlockedIndefinitely
@@ -652,6 +655,9 @@ instance Exception BlockedIndefinitely
 instance Show BlockedIndefinitely where
     showsPrec _ BlockedIndefinitely = showString "thread blocked indefinitely"
 
+blockedIndefinitely :: SomeException -- for the RTS
+blockedIndefinitely = toException BlockedIndefinitely
+
 -----
 
 data Deadlock = Deadlock
@@ -814,13 +820,9 @@ data IOErrorType
   | TimeExpired
   | ResourceVanished
   | Interrupted
-  | DynIOError Dynamic -- cheap&cheerful extensible IO error type.
 
 instance Eq IOErrorType where
-   x == y = 
-     case x of
-       DynIOError{} -> False -- from a strictness POV, compatible with a derived Eq inst?
-       _ -> getTag x ==# getTag y
+   x == y = getTag x ==# getTag y
  
 instance Show IOErrorType where
   showsPrec _ e =
@@ -845,7 +847,6 @@ instance Show IOErrorType where
       TimeExpired       -> "timeout"
       UnsatisfiedConstraints -> "unsatisified constraints" -- ultra-precise!
       UnsupportedOperation -> "unsupported operation"
-      DynIOError{}      -> "unknown IO error"
 
 -- | Construct an 'IOError' value with a string describing the error.
 -- The 'fail' method of the 'IO' instance of the 'Monad' class raises a