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

Skip to content

Conversation

@quelgar
Copy link
Contributor

@quelgar quelgar commented Jul 18, 2020

Implement ZStream#refineToOrDie.

Also implement ZManaged#refineToOrDie in the same way as for ZIO, for type safety.

Also implement ZManaged#refineToOrDie in the same way as for ZIO,
for type safety.
@quelgar quelgar requested a review from iravid as a code owner July 18, 2020 13:16
/**
* Keeps some of the errors, and terminates the fiber with the rest.
*/
def refineToOrDie[E1 <: E: ClassTag](implicit ev: CanFail[E]): ZManaged[R, E1, A] =
Copy link
Member

Choose a reason for hiding this comment

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

Can we keep it on the class with implicit evidence? (implicit ev: E <:< Throwable). Better discoverability that way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, but the cost is that we can no longer constrain E1 <: E and the test cases won't pass (#2355). This PR is just a copy of what was done for zio.ZIO (#2360) to fix that.

/**
* Keeps some of the errors, and terminates the fiber with the rest.
*/
def refineToOrDie[E1 <: E: ClassTag](implicit ev: CanFail[E]): ZStream[R, E1, A] =
Copy link
Member

Choose a reason for hiding this comment

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

Same - can we keep it on the class?

Copy link
Member

@iravid iravid left a comment

Choose a reason for hiding this comment

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

Thanks @quelgar - reviewed #2360 and now see why this is necessary

@iravid iravid merged commit 39c19b7 into zio:master Jul 21, 2020
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.

2 participants