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

servant-server: make file-serving functions polymorphic in the monad #953

Merged
merged 1 commit into from Apr 26, 2018

Conversation

Projects
None yet
2 participants
@alpmestan
Copy link
Contributor

alpmestan commented Apr 25, 2018

This simply seems possible without breaking anything, so why not?

I've only tried to build servant-server and the tutorial. Let's see what CI says, but it seems to me like the monad is never going to be ambiguous, unless you have a single handler which does file serving, but you still use another monad and call hoistServer on your handler, maybe?

Thoughts?

@phadej

phadej approved these changes Apr 25, 2018

@alpmestan

This comment has been minimized.

Copy link
Contributor Author

alpmestan commented Apr 25, 2018

Alright, CI passes (except 7.8 of course, but that's not new), so it seems like there is no problem with generalising the monad in the typical use cases. I think it's sane that in the case I mentionned above, one has to add some type annotations to let ghc know what the source monad is. If anyone disagrees, please let your voice be heard!

@phadej

This comment has been minimized.

Copy link
Member

phadej commented Apr 25, 2018

@alpmestan feel free to merge when you are satisfied with "discussion".

@alpmestan

This comment has been minimized.

Copy link
Contributor Author

alpmestan commented Apr 26, 2018

Alright, let's merge this then =)

@alpmestan alpmestan merged commit 0c66b9c into master Apr 26, 2018

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details

@alpmestan alpmestan deleted the fileserving-polymorphic-monad branch Apr 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.