Skip to content
Snippets Groups Projects
Unverified Commit af59d648 authored by Michael Snoyman's avatar Michael Snoyman
Browse files

Further generalization of generalBracket

I just realized that the function could be more general, and thereby
more explicit in its intent, but allowing the non-exceptional release
function to return a different type than the inner function.
parent ec0cdadd
No related branches found
No related tags found
No related merge requests found
......@@ -191,13 +191,13 @@ class MonadCatch m => MonadMask m where
generalBracket
:: m a
-- ^ acquire some resource
-> (a -> b -> m b)
-> (a -> b -> m c)
-- ^ cleanup, no exception thrown
-> (a -> SomeException -> m ignored)
-- ^ cleanup, some exception thrown. The exception will be rethrown
-> (a -> m b)
-- ^ inner action to perform with the resource
-> m b
-> m c
instance MonadThrow [] where
throwM _ = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment