Skip to content

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

Merged
alpmestan merged 1 commit into
masterfrom
fileserving-polymorphic-monad
Apr 26, 2018
Merged

servant-server: make file-serving functions polymorphic in the monad#953
alpmestan merged 1 commit into
masterfrom
fileserving-polymorphic-monad

Conversation

@alpmestan

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

phadej commented Apr 25, 2018

Copy link
Copy Markdown
Contributor

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

@alpmestan

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