@hackage resourcet1.1.6

Deterministic allocation and freeing of scarce resources.

resourcet

Please see the full tutorial on School of Haskell.

This package was originally included with the conduit package, but has existed as a separate package for quite a while. It is fully usable outside of conduit.