-
Notifications
You must be signed in to change notification settings - Fork 367
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
JSON return type for Handlers? #1481
Comments
cc @gregwebs since you authored that blog post |
Looks good |
Closed by #1592 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So I was thinking about this blog post recently http://tech.frontrowed.com/2015/12/21/servant-style-handlers-for-yesod/, that uses
UndecidableInstances
to let you specify the return type of your Handlers that return JSON asHandler <RecordName>
rather thanHandler Value
Why not just have something like this?
Then handlers are typed as:
and the function returns:
Slightly more overhead than the blog post version. I don’t know if
UndecidableInstances
is actually worth avoiding though. Thoughts? I think endorsing one or the other of these options would be good for Yesod to do—it seems much better than returningValue
.The text was updated successfully, but these errors were encountered: