Had some time to read this. Seems good so far, and I like how you made it obvious which lines were changed. Really useful.
sekun@pop-os:~/Projects/hweather$ stack install
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for hweather-0.1.0.0:
servant-flatten needed, but the stack configuration has no specified version (latest matching version is 0.2)
needed since hweather is a build target.
Some different approaches to resolving this:
* Recommended action: try adding the following to your extra-deps in /home/sekun/Projects/hweather/stack.yaml:
I followed its recommendation but I’m not sure if I’m supposed to cause I don’t know what stack trickery is required since I’ve never used it before. It seems to be fine.
So with this one I was kinda confused with for a bit since I wasn’t sure exactly what the
curl request would look like for
PUT /api/weather/:location. It doesn’t mention how the user could try this out, only for the
To be more specific, I was confused with how
ReqBody translates to the actual JSON body. Servant’s docs had a
User object which I assumed that it would just be a JSON object but was confused with what the key of the JSON object would be in this case. Turns out, the entire thing was just a string! Well, figures hahah.
:<|> ReqBody '[JSON] String :> Put '[JSON] String
So turns out it was just this:
> curl -H "Content-Type: application/json" -X PUT -d '"sunny"' localhost:8888/api/weather/Paris