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

Re-export ReleaseKey and ResourceCleanupException #5

Merged
merged 4 commits into from
Nov 1, 2023

Conversation

mmhat
Copy link
Contributor

@mmhat mmhat commented Aug 23, 2023

Fixes #2

I also updated the CI setup and added bindings for release and unprotect.
@arybczak Maybe we can cut a new release at this point?

Copy link
Contributor

@arybczak arybczak left a comment

Choose a reason for hiding this comment

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

Please split the CI part into a separate PR.


-- | A variant of 'R.unprotect' adjusted to work in the 'Eff' monad.
--
-- /Note:/ the @release@ action returned will run a clone of the environment it
Copy link
Contributor

@arybczak arybczak Aug 24, 2023

Choose a reason for hiding this comment

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

Will it? I don't know what unprotect does, but I don't see cloneEnv below (unlike in allocateEff).

Also, is having es and es' correct here? Does it make sense to be able to run the returned action in a completely different stack?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will it? I don't know what unprotect does, but I don't see cloneEnv below (unlike in allocateEff).

You're right, it does not run in a cloned environment - at least not necessarily. I wrote the note with alloacteEff in mind and there the release action is run in a cloned environment. I updated the note to be a bit clearer on that.

Also, is having es and es' correct here? Does it make sense to be able to run the returned action in a completely different stack?

Yes, I think it makes sense. Consider the use case mentioned in the documentation of the unprotect:

Unprotect resource from cleanup actions; this allows you to send resource into another resourcet process and reregister it there.

We don't now what the effect row of that other resourcet process looks like and it might (and probably will) be different from the one we are in when calling unprotectEff.

@mmhat
Copy link
Contributor Author

mmhat commented Aug 25, 2023

Please split the CI part into a separate PR.

I moved the CI part to #6.

src/Effectful/Resource.hs Outdated Show resolved Hide resolved
@mmhat mmhat mentioned this pull request Oct 25, 2023
@arybczak arybczak merged commit 17c6104 into haskell-effectful:master Nov 1, 2023
6 checks passed
@mmhat mmhat deleted the 2-reexport-key branch November 3, 2023 15:47
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.

Can you please add ReleaseKey and ResourceCleanupException to the export list?
2 participants