forked from haskell-servant/servant-elm
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Rebase on mattjbray/servant-elm and fix codegen for headers and query params #8
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…’s type is Maybe SomethingLikeString.
Temporary fix for Header.
use the "elmName" rather than "name" for query flags and param lists
Sometimes you need the headers. Sometimes you need the status code. Since those values are always available for every request, we can return them by default. If you don't need the response, it's straight forward to remove it. E.g. If before you had something like: ``` Http.send handleResult request ``` And you wanted to get rid of the request, you would now do: ``` Http.send (handleResult << Result.map .body) request ```
This is causing warnings in dependent projects.
…use the right composition operator for maybe types in toStringSrc
This PR appears stale. Closing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi folks!
I told @lukewestby the other day that our company wanted to use NRI's fork of servant-elm to get 0.19 support, but would require some tweaks, and that I'd be happy to help get them upstreamed.
Well, those tweaks (so far) are here, and they're a little more ambitious than I initially thought..... but hopefully useful for all parties.
I did a couple things:
rebased on the current master of mattjbray/servant-elm. This seemed like the most straightforward way to get support for
servant
0.13 and backport a couple of codegen fixes I've made there over the past year.Once that was done, I was seeing weird behavior in the codegen for headers and query params, where the type of the function argument would be
Maybe a
, but the code totoString
it thought the type wasMaybe (Maybe a))
. I fixed this with some admittedly ugly hacks, but the tests are back to passing.Travis CI seems to be broken on my fork, so if that's the case here as well, I'll work on getting it sorted out next.
After that, I want to add the ability to generate code using
Http.task
instead ofHttp.request
, since our app relies onandThen
ing together http calls somewhat heavily. I'll probably make a separate PR for that change when I get something working.Anyways, I hope you take a look at the code here when you can, and give any feedback that comes to mind.