Automatic Resource Management Library

One comment on complexity and expressiveness: resource management more looks like context-aware thing, not a sequencing thing. As e.g. Martin says in every talk about Dotty, monads (and monadic fors in particular) are more about sequencing rather than about just management of a context (because sequencing requires more power).

Things in your example are more elegantly (IMO) solved by structures like on this talk by @densh.