Skip to content

Commit

Permalink
improved scaladoc for surround and surroundK
Browse files Browse the repository at this point in the history
  • Loading branch information
pkowalcze committed Nov 6, 2020
1 parent 0bd5660 commit dda1b39
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -419,13 +419,13 @@ 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.
* Acquires the resource, runs `gb` and closes the resource once `gb` terminates, fails or gets interrupted
*/
def surround[G[x] >: F[x]: Resource.Bracket, B](gb: G[B]): G[B] =
use(_ => gb)

/**
* Creates a FunctionK that wraps an effect in a usage when applied. Value produced by the resource is ignored.
* Creates a FunctionK that can run `gb` within a resource, which is then closed once `gb` terminates, fails or gets interrupted
*/
def surroundK[G[x] >: F[x]: Resource.Bracket]: G ~> G =
new (G ~> G) {
Expand Down

0 comments on commit dda1b39

Please sign in to comment.