bracket<ENV, A, B> function
Implementation
ReaderIO<ENV, B> Function(ReaderIO<ENV, A>) bracket<ENV, A, B>({
required ReaderIO<ENV, void> Function(A) release,
required ReaderIO<ENV, B> Function(A) use,
}) =>
(acquire) => (env) {
final acquireF = acquire(env);
return () {
final resource = acquireF();
try {
return use(resource)(env)();
} finally {
release(resource)(env)();
}
};
};