-
Couldn't load subscription status.
- Fork 1.4k
Restore bracket on zio actions #1694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| final def bracket: ZIO.BracketAcquire[R, E, A] = | ||
| new ZIO.BracketAcquire(self) | ||
|
|
||
| final def bracketExit: ZIO.BracketExitAcquire[R, E, A] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot bracketExit!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is already there in fact 🧐
| */ | ||
| def bracketAuto[R1 <: R, E1 >: E, B](use: A => ZIO[R1, E1, B]): ZIO[R1, E1, B] = | ||
| io.bracket(a => UIO(a.close()))(use) | ||
| io.bracket[R1, E1, B](a => UIO(a.close()), use) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't that look like a reason for invariant syntax to be there? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. Backout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess so 😟 then remove bracketExit from the main class too?
|
Probably so if we can show type inference issues... |
This reverts commit 178fad2.
|
I don't think it needs to be reverted: #1696 |
* Restore zio.bracket shorthands * Drop invariant syntactic sugar
The method existed only inside an implicit class for invariant types, but it doesn't seem necessary. Besides it's missing from the scaladoc which is quite surprising (since
bracket_is there).