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

Resource management in ExceptT stacks #632

Closed
3noch opened this issue Nov 3, 2016 · 4 comments
Closed

Resource management in ExceptT stacks #632

3noch opened this issue Nov 3, 2016 · 4 comments
Milestone

Comments

@3noch
Copy link

3noch commented Nov 3, 2016

I would like some feedback from the "horse's mouth" so to speak:

http://stackoverflow.com/questions/40372087/what-is-the-best-way-to-manage-resources-in-an-monad-stack-like-exceptt-a-io

What do you guys do?

@jkarni
Copy link
Member

jkarni commented Nov 23, 2016

Relates to #641

@phadej phadej added this to the 0.10 milestone Jan 13, 2017
@phadej
Copy link
Contributor

phadej commented Jan 19, 2017

@3noch have you tried e.g. enter (Nat runResourceT) yourHandlers? The #676 would solve it from the inside of servant, but AFAICS enter (Nat runResourceT) should work?

Also Handler is now MonadBaseControl IO, so you can always use that (already with current servant, as there is MonadBaseControl b (ExceptT e b)

@phadej
Copy link
Contributor

phadej commented Jan 19, 2017

Both old type and newtype Handler's are instance of MonadBaseControl IO, so you can use lifted-base's bracket

@phadej phadej closed this as completed Jan 19, 2017
@3noch
Copy link
Author

3noch commented Jan 19, 2017

@phadej Thanks. That's how I ended up doing it.

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

3 participants