X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FIO.hs;h=9fa7299dd5ec522c8c0a504a5ee3b17ad1e002ed;hb=41e8fba828acbae1751628af50849f5352b27873;hp=c57abdc5d14bdcee330b13c35f5dda41eff0942e;hpb=4c29f6f110d23b890567b8696a964bb212eba52e;p=ghc-base.git diff --git a/GHC/IO.hs b/GHC/IO.hs index c57abdc..9fa7299 100644 --- a/GHC/IO.hs +++ b/GHC/IO.hs @@ -1,5 +1,10 @@ +{-# LANGUAGE NoImplicitPrelude + , BangPatterns + , RankNTypes + , MagicHash + , UnboxedTuples + #-} {-# OPTIONS_GHC -funbox-strict-fields #-} -{-# LANGUAGE NoImplicitPrelude, BangPatterns, RankNTypes #-} {-# OPTIONS_HADDOCK hide #-} ----------------------------------------------------------------------------- -- | @@ -254,7 +259,7 @@ catchException :: Exception e => IO a -> (e -> IO a) -> IO a catchException (IO io) handler = IO $ catch# io handler' where handler' e = case fromException e of Just e' -> unIO (handler e') - Nothing -> raise# e + Nothing -> raiseIO# e catchAny :: IO a -> (forall e . Exception e => e -> IO a) -> IO a catchAny (IO io) handler = IO $ catch# io handler' @@ -344,7 +349,7 @@ blocked = fmap (/= Unmasked) getMaskingState onException :: IO a -> IO b -> IO a onException io what = io `catchException` \e -> do _ <- what - throw (e :: SomeException) + throwIO (e :: SomeException) -- | Executes an IO computation with asynchronous -- exceptions /masked/. That is, any thread which attempts to raise