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

Add a solution for composing bracketed resources #254

Closed
iravid opened this issue Sep 15, 2018 · 2 comments
Closed

Add a solution for composing bracketed resources #254

iravid opened this issue Sep 15, 2018 · 2 comments

Comments

@iravid
Copy link
Member

iravid commented Sep 15, 2018

Composing brackets is a pain:

val resource1: IO[E, R1]
val resource2: IO[E, R2]

resource1.bracket(release1) { r1 =>
  resource2.bracket(release2) { r2 =>
    // ...
  }
}

Prior art:

@neko-kai
Copy link
Member

There's also Using in 2.13 standard library that does this for Try - scala/scala#6907

@iravid
Copy link
Member Author

iravid commented Sep 15, 2018

True. Added that and cats-effect's Resource

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

No branches or pull requests

2 participants