Note that a `Handle` can escape from `withFile` (unless perhaps this library has been updated to use linear types, I haven't followed Haskell in a while).
That being said, even without linear types, it's much harder to accidentally leak a scoped value in Haskell than in most other programming languages, as the leak shows up in the type signature.
/pedantic