Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Use something like "lightweight monadic regions" to handle iteratee cleanup #99
Currently with the enumerator package, there is no way to ensure that resources opened by iteratees are cleaned up if the enumerator fails (e.g. "connection closed by peer" on the read socket). We are forced to use ugly workaround hacks like MVar finalizers to deal with this.
Oleg's lightweight monadic regions paper contains a generic technique for dealing with this problem; we don't necessarily have to go to RegionT, but an IORef-based "resource manager" could help here.