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

Rebase on mattjbray/servant-elm and fix codegen for headers and query params #8

Closed
wants to merge 30 commits into from

Conversation

nicklawls
Copy link

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:

  1. 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.

  2. 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 to toString it thought the type was Maybe (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 of Http.request, since our app relies on andThening 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.

hadronized and others added 30 commits December 1, 2017 17:22
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
@rekahsoft
Copy link

This PR appears stale. Closing.

@rekahsoft rekahsoft closed this Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants