This repository was archived by the owner on Dec 23, 2025. It is now read-only.

Description
It's a common task in IO related code to finalize some IO action, e.g. perform file.close or socket.close when those resources aren't needed anymore. In Http.lean we need to use it to handle connections. Later it can be a great candidate for a separate lib or stdlib.
In general it has the following structure:
- The acquire action of
IO α
- The release action of
α → IO Unit
use function of α → IO β
Monad instance
Examples:
- Haskell
- Scala
It's a bit problematic though given how much typical FP instances are in Mathlib4 - I suspect we might need to depend on it.