-
Notifications
You must be signed in to change notification settings - Fork 529
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
Conversation
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 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. |
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 would change this scaladoc to something like:
acquires the resource, runs `gb`, and closes the resource once `gb` terminates, fails or gets interrupted
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.
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
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.
Updated the scaladoc
As requested in #1338 - added
surround
andsurroundK
methods onResource