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

alpmestan
Copy link
Contributor

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?

@alpmestan
Copy link
Contributor Author

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
Copy link
Contributor

phadej commented Apr 25, 2018

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

@alpmestan
Copy link
Contributor Author

Alright, let's merge this then =)

@alpmestan alpmestan merged commit 0c66b9c into master Apr 26, 2018
@alpmestan alpmestan deleted the fileserving-polymorphic-monad branch April 26, 2018 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants