I think pjmpl is referencing apis like this:
with_file "hello.txt" (fun fd -> (* do stuff *) )
where you've basically created a c++ destructor style api with a lambda.It's certainly not "verification" in any formal sense, and the type system can't help you there any more than it can in c++.
But this is a perfectly reasonable pattern.