general-allocate: Exception-safe resource management in more monads
Write monad-generic resource-safe code that can be instantiated in both IO and pure contexts.
which generalizes the
bracket pattern but only for monads that can catch exceptions
(i.e., transformer stacks on top of
Either SomeException). resourcet
which allows for arbitrarily interleaved allocations and releases of resources, but only
MonadUnliftIO. This module provides type-classes for both types of resource allocation
which can be properly instantiated at more monads, through the expedient of weakening a
requirement which doesn't matter in the cases where it's not met: In monads that can't catch
exceptions, release actions will not be called in the case of an exception (asynchronous or
otherwise), but in those same monads the entire monadic computation will be terminated by
the same exception and so resource management has ended anyway.
See Control.Monad.With for scoped (
bracket-style) resource management.
See Control.Monad.Allocate for arbitrary lifetime resource management.
See Data.GeneralAllocate to define values that can be used for allocation in either resource management style.
|Versions [RSS]||0.1.0.0, 0.1.1.0, 0.2.0.0, 0.2.0.1, 0.2.1.0, 0.2.1.1, 0.2.1.2, 0.2.1.3, 0.2.1.4|
|Dependencies||base (>=4.14 && <4.15 || >=4.16 && <4.18), containers (>=0.6 && <0.7), mtl (>=2.2 && <2.4), primitive (>=0.7 && <0.9), resourcet (>=1.3 && <1.4), safe-exceptions (>=0.1 && <0.2), transformers (>=0.5 && <0.7) [details]|
|Copyright||Coypright 2022 Shea Levy.|
|Source repo||head: git clone https://github.com/shlevy/general-allocate|
|Uploaded||by shlevy at 2023-03-01T21:44:27Z|
|Reverse Dependencies||2 direct, 3 indirect [details]|
|Downloads||280 total (14 in the last 30 days)|
|Rating||(no votes yet) [estimated by Bayesian average]|
|Status||Docs available [build log]
Last success reported on 2023-03-01 [all 1 reports]