4 ms·
This is true, if you write `bracket` for e.g. `Exception`, then you can break out of the bracket with `abort` if your bracket doesn't handle aborts. So if you
by zawodnaya 4y ago
This is true, if you write `bracket` for e.g. `Exception`, then you can break out of the bracket with `abort` if your bracket doesn't handle aborts.
So if you want to be really sure of resource cleanup, you should use something like the `Resource` ability to acquire resources:
https://share.unison-lang.org/@runarorama/code/latest/namespaces/public/resource/latest https://share.unison-lang.org/@runarorama/code/latest/namesp...
- dwohnitmok 4y agoGot it. But you're locked into IO and Exception then and can't use any other abilities right? I guess you could always convert back and forth at the `run` boundary. Also I would suggest removing Exception.bracket from base then, or at least changing the file handle example for Exception.bracket, since it seems a tad dangerous.