You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the following approach for url segments + query params + headers:
Create a "stringifier" for types (similar to decoders and encoders) that works for integers, strings, enums and newtypes over all these (for now since these are the only things I'm currently using).
This relies on the user using Show/Read for their {To,From}HttpApiData instances, which could be made easier for DerivingVia usage like the ElmStreet newtype is for {To,From}JSON.
Use this stringifier to create segments/params/headers, with additionally supporting Maybe versions of these.
I don't know of a better approach than this "stringifier" thing, and looking at servant-elm they also seem to assume that their e.g. query parameters are always integers/strings.
I ended up copying a lot of code from elm-street - e.g. I need to know names of types and decoders/encoders so I can use them in my requests, so if this ends up working fine I might do a PR to expose these from here, if it's fine.
TODO
The text was updated successfully, but these errors were encountered: