Unverified Commit 3d489236 authored by Michael Snoyman's avatar Michael Snoyman
Browse files

More consistent generalBracket implementations

The behavior is identical to before, but since I'm about to use these
instances in the docs, I wanted to raise less confusing questions to
readers about implementation.
parent 7ec3240e
......@@ -474,8 +474,8 @@ instance (Error e, MonadMask m) => MonadMask (ErrorT e m) where
Right resource -> runErrorT (release resource) >> return ())
(\eresource e ->
case eresource of
Left _ -> throwM e
Right resource -> runErrorT (cleanup resource e))
Left _ -> return ()
Right resource -> runErrorT (cleanup resource e) >> return ())
(either (return . Left) (runErrorT . use))
-- | Throws exceptions into the base monad.
......@@ -505,8 +505,8 @@ instance MonadMask m => MonadMask (ExceptT e m) where
Right resource -> runExceptT (release resource) >> return ())
(\eresource e ->
case eresource of
Left _ -> throwM e
Right resource -> runExceptT (cleanup resource e))
Left _ -> return ()
Right resource -> runExceptT (cleanup resource e) >> return ())
(either (return . Left) (runExceptT . use))
instance MonadThrow m => MonadThrow (ContT r m) where
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment