WithResource combinator for Servant-managed resources#1630
WithResource combinator for Servant-managed resources#1630tchoutri merged 2 commits intohaskell-servant:masterfrom
Conversation
|
@andremarianiello Hi! Thank you for the PR. :) I see a couple of leftover TODOs, ping me when the PR is ready for review. |
4c44a10 to
26db6a8
Compare
|
@tchoutri Whoops, sorry about that! I have replaced the TODO with documentation. Should be ready for review now. |
|
|
||
| hoistServerWithContext _ pc nt s = hoistServerWithContext (Proxy @api) pc nt . s | ||
|
|
||
| route Proxy context d = route (Proxy @api) context (d `addParameterCheck` allocateResource) |
There was a problem hiding this comment.
This addParameterCheck feels a bit hacky to me because allocateResource is not actually doing a parameter check, but I don't know of a better way to incorporate this allocation into the underlying ResourceT. If using addParameterCheck this way is too egregious I am of course open to alternatives.
26db6a8 to
2a1f903
Compare
|
@tchoutri ready for review |
|
Do you have any idea what is causing the CI failures? I don't see how they are related to my changes and I cannot reproduce the failure locally. |
|
Lots of successes in the last run, but the failure looks like its caused by Any idea what's going on? |
|
Yes, I'm going to disable the stack CI for the foreseeable future, it's no longer a good indicator of software quality. |
Hi! This is the PR discussed in #1345 , cookbook included.