X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Control%2FException%2FBase.hs;h=fb4f6de878fa427eaa09a03982a5d003ad868fc7;hb=1523de9c11a0663e538f00679f6a4a682295b2de;hp=8ea4bf4bda531425dd051b8eac287636385259ae;hpb=2ef602649e643622ea1f2d10c017e05f979e55fa;p=ghc-base.git diff --git a/Control/Exception/Base.hs b/Control/Exception/Base.hs index 8ea4bf4..fb4f6de 100644 --- a/Control/Exception/Base.hs +++ b/Control/Exception/Base.hs @@ -426,7 +426,7 @@ catchJust -> IO a catchJust p a handler = catch a handler' where handler' e = case p e of - Nothing -> throw e + Nothing -> throwIO e Just b -> handler b -- | A version of 'catch' with the arguments swapped around; useful in @@ -452,7 +452,7 @@ handleJust p = flip (catchJust p) mapException :: (Exception e1, Exception e2) => (e1 -> e2) -> a -> a mapException f v = unsafePerformIO (catch (evaluate v) - (\x -> throw (f x))) + (\x -> throwIO (f x))) ----------------------------------------------------------------------------- -- 'try' and variations. @@ -482,14 +482,14 @@ tryJust p a = do case r of Right v -> return (Right v) Left e -> case p e of - Nothing -> throw e + Nothing -> throwIO e Just b -> return (Left b) -- | Like 'finally', but only performs the final action if there was an -- exception raised by the computation. onException :: IO a -> IO b -> IO a onException io what = io `catch` \e -> do _ <- what - throw (e :: SomeException) + throwIO (e :: SomeException) ----------------------------------------------------------------------------- -- Some Useful Functions