Skip to content
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

surround and surroundK added to Resource #1368

Merged
merged 3 commits into from
Nov 6, 2020

Conversation

pkowalcze
Copy link
Contributor

As requested in #1338 - added surround and surroundK methods on Resource

Copy link
Contributor

@SystemFw SystemFw left a comment

Choose a reason for hiding this comment

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

I suggested a tiny scaladoc improvement, but it's otherwise good to go

@@ -417,6 +417,20 @@ sealed abstract class Resource[+F[_], +A] {
*/

private[effect] def invariant: Resource.InvariantResource[F0, A]

/**
* Wraps an effect in a usage and ignores the value produced by resource.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would change this scaladoc to something like:

acquires the resource, runs `gb`, and closes the resource once `gb` terminates, fails or gets interrupted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good 👍 And for surroundK would the following be ok?

Creates a FunctionK that can run `gb` within a resource, which is then closed once `gb` terminates, fails or gets interrupted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the scaladoc

@kubukoz kubukoz merged commit 1ff137f into typelevel:series/3.x Nov 6, 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.

3 participants