haskell-servant / servant-elm

Automatically derive Elm functions to query servant webservices
BSD 3-Clause "New" or "Revised" License
164 stars 48 forks source link

Update for servant 0.8 and elm compatibility #8

Closed purcell closed 8 years ago

purcell commented 8 years ago

Heya, so I'm keen to use servant-elm with the latest servant version, and had a go at making that work. This PR contains the changes that seemed necessary and/or desirable as part of that process:

I noticed that there's an elm-export 0.4.0.1 in Hackage, but this doesn't work with servant-elm's code as-is, and it wasn't immediately obvious to me how to update the servant-elm code accordingly. With some pointers, that might be something I could tackle.

/cc @krisajenkins

mattjbray commented 8 years ago

Thanks!

Unfortunately updating to the latest elm-export is non-trivial, since servant-elm is currently using a fork that has some extra functionality - see https://github.com/krisajenkins/elm-export/pull/4 and https://github.com/krisajenkins/elm-export/pull/5.

The process at the moment is:

  1. Rebase those two PRs onto the devel branch in https://github.com/krisajenkins/elm-export. The rebasing is likely to be non-trivial.
  2. Over in https://github.com/mattjbray/elm-export create a new branch from the latest krisajenkins/devel, and merge in the two rebased PR branches. The merge is slightly non-trivial.
  3. Reference the resulting merge commit in this repo's stack.yaml.
  4. Update this repo for any API changes in elm-export.

If you want to take a stab at this feel free, otherwise I will do it some time over the next week.

purcell commented 8 years ago

Yeah, there's going to be more work than that because Kris has (very reasonably) switched from String to Text recently... :-)

purcell commented 8 years ago

So here's what I've done so far: I pointed the stack.yaml reference at the current tip of Kris' devel branch (8e64241a8ad5192afe87cdcb5b3791b886453aeb). That primarily turns up the differences you've submitted upstream in krisajenkins/elm-export#4, and then I got bogged down in understanding why those are necessary. I'm quite possibly just having a slow brain day.

krisajenkins commented 8 years ago

Hey folks,

I've done some fairly major rework of the internal datastructures for elm-export. It's still the same on the outside, but the branch you probably want to work off of is rework-adt. What's in there will eventually become v0.5.

So when's 'eventually'? Probably when I come up with a satisfying solution for https://github.com/krisajenkins/elm-export/issues/6, which is still bugging me. Any suggestion on that are most welcome. :-)