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

servant-client: replace BaseUrl with uri-bytestring #949

Open
domenkozar opened this issue Apr 18, 2018 · 3 comments
Open

servant-client: replace BaseUrl with uri-bytestring #949

domenkozar opened this issue Apr 18, 2018 · 3 comments

Comments

@domenkozar
Copy link
Contributor

domenkozar commented Apr 18, 2018

Looking at https://hackage.haskell.org/package/servant-client-core-0.13.0.1/docs/Servant-Client-Core-Internal-BaseUrl.html I can think of following benefits/reasons switching to https://hackage.haskell.org/package/uri-bytestring-0.3.1.1/docs/URI-ByteString.html#t:URIRef

a) haskell code around client can use URIRef type to construct the base url and pass it directly to servant-client

b) No changes necessary to servant-client, if for example one chooses to use basic auth (given that's it's mandated by proxy like nginx)

c) uri-bytestring is already a dependency of http-api-data that servant-client-core depends on

d) Removal of BaseUrl and the need to maintain it

Duplicates #139

@domenkozar domenkozar changed the title servant-client: replace BaseUrl with Network.URI.URI servant-client: replace BaseUrl with uri-bytestring Apr 18, 2018
@phadej
Copy link
Contributor

phadej commented Apr 20, 2018

 @domenkozar title is about uri-bytestring, body is about network-uri.

Note #139 is (mostly) about Links not Client.

@domenkozar
Copy link
Contributor Author

@phadej fixed.

@tysonzero
Copy link

It seems like modern-uri might be a better library to use than uri-bytestring? Haven't done a detailed comparison but I much prefer the use of Text over ByteString for textual data like URIs.

Soostone/uri-bytestring#54

I'm open to arguments in favor of ByteString though, in case there is something I am missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants