You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a super small library, but I think it's helpful enough to have as a separate library. resource-pool and resourcet probably don't want to incur a dependency on the other (which makes sense to me), and I was searching Hackage for a way to use withAcquire with a Pool. Providing this library would provide a quick solution if one ends up in this situation.
For me personally, I would like to use withAcquire because it uses MonadUnliftIO, whereas withResource uses MonadBaseControl (see bos/pool#31 and bos/pool#37). But I'm sure there are other situations where this might be useful (e.g. using a Pool within the MonadResource context)
This is a super small library, but I think it's helpful enough to have as a separate library.
resource-pool
andresourcet
probably don't want to incur a dependency on the other (which makes sense to me), and I was searching Hackage for a way to usewithAcquire
with aPool
. Providing this library would provide a quick solution if one ends up in this situation.For me personally, I would like to use
withAcquire
because it usesMonadUnliftIO
, whereaswithResource
usesMonadBaseControl
(see bos/pool#31 and bos/pool#37). But I'm sure there are other situations where this might be useful (e.g. using aPool
within theMonadResource
context)I mostly copied from
persistent
's code here:https://github.com/yesodweb/persistent/blob/9e6d88d767035d3e62252666ab3083ab576257bf/persistent/Database/Persist/Sql/Run.hs#L33-L45
I would love a quick review from the maintainers of these packages, to check:
Many thanks in advance!
cc @bos @snoyberg
The text was updated successfully, but these errors were encountered: