throwIO, block, unblock, blocked, catchAny, catchException,
evaluate,
ErrorCall(..), AssertionFailed(..), assertError, untangle,
- BlockedOnDeadMVar(..), BlockedIndefinitely(..), Deadlock(..)
+ BlockedOnDeadMVar(..), BlockedIndefinitely(..), Deadlock(..),
+ blockedOnDeadMVar, blockedIndefinitely
) where
import GHC.ST
#ifndef __HADDOCK__
import {-# SOURCE #-} Data.Typeable ( Typeable )
-import {-# SOURCE #-} Data.Dynamic ( Dynamic )
#endif
-- ---------------------------------------------------------------------------
instance Show BlockedOnDeadMVar where
showsPrec _ BlockedOnDeadMVar = showString "thread blocked indefinitely"
+blockedOnDeadMVar :: SomeException -- for the RTS
+blockedOnDeadMVar = toException BlockedOnDeadMVar
+
-----
data BlockedIndefinitely = BlockedIndefinitely
instance Show BlockedIndefinitely where
showsPrec _ BlockedIndefinitely = showString "thread blocked indefinitely"
+blockedIndefinitely :: SomeException -- for the RTS
+blockedIndefinitely = toException BlockedIndefinitely
+
-----
data Deadlock = Deadlock
| 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 =
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