[Haskell-cafe] Exception safe resource management with dynamic regions, call for review
carter.schonwald at gmail.com
Sun Feb 15 20:39:04 UTC 2015
huh, this is a pretty neat little api for resource pools, i'll have to take
some time to dig into it when i get the chance!
thanks for sharing.
On Sat, Feb 14, 2015 at 4:36 PM, Yuras Shumovich <shumovichy at gmail.com>
> I'm asking for code and design review for `io-region` library. It is
> already on Hackage for convenience and easy access to haddock:
> Manual exception handling in Haskell almost never is a good idea, except
> probably trivial cases where `bracket` is enough. A number of special
> libraries where created to help with exception handling. `io-regions` is
> one of them.
> Initially it was an attempt to solve the double-throw issue, but I found
> it unsolvable in library without changes in language itself. So now it
> is an attempt to design easy to use API with a bit different set of
> The library is based on idea of regions that own resources. The
> resources are released when the region is closed. Early releasing and
> ownership transferring are supported. Types are *not* used to prevent
> use-after-free errors.
> The API is not monadic, and it is the biggest difference from other
> libraries. Regions are first-class citizens, so you can manipulate them,
> pass as arguments to functions, send to other thread, store in data
> types. Such flexibility has its cost -- a bit more manual management.
> The implementation is based on STM and is thread safe, that allows e.g.
> atomic ownership transferring between threads.
> The nearest competitor I think is `resourset` package, and I still
> recommend it by default. Though I convinced myself that `io-region` is
> good enough, and I'm using it in productions (for two weeks already :) )
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe