Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@regiskuckaertz
Copy link
Member

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).

final def bracket: ZIO.BracketAcquire[R, E, A] =
new ZIO.BracketAcquire(self)

final def bracketExit: ZIO.BracketExitAcquire[R, E, A] =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot bracketExit!

Copy link
Member Author

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 🧐

@jdegoes jdegoes merged commit 178fad2 into zio:master Sep 17, 2019
@regiskuckaertz regiskuckaertz deleted the rk-restore-bracket branch September 17, 2019 14:17
*/
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)
Copy link
Member

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? 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Backout?

Copy link
Member Author

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?

@jdegoes
Copy link
Member

jdegoes commented Sep 17, 2019

Probably so if we can show type inference issues...

regiskuckaertz pushed a commit that referenced this pull request Sep 17, 2019
@regiskuckaertz
Copy link
Member Author

I don't think it needs to be reverted: #1696

fsvehla pushed a commit to fsvehla/zio that referenced this pull request Sep 21, 2019
* Restore zio.bracket shorthands

* Drop invariant syntactic sugar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants