elldritch / hipsterfy

Find out which Spotify hipsters you and your friends both like.
https://hipsterfy.com
Apache License 2.0
7 stars 0 forks source link

Safer Spotify API query DSL #3

Open elldritch opened 4 years ago

elldritch commented 4 years ago

In general, I'm pretty unsatisfied with our ability to construct URLs. This seems to be somewhere that Haskell shockingly lags behind Go in type-safety - I haven't found an equivalent of path.Join or any useful data structures for representing URLs beyond careful string concatenation.

For an example of where this makes for a dangerous API, see:

https://github.com/liftM/hipsterfy/blob/2af2a3c939b4f29aac0cdb8adca513d7300b5c21/src/Hipsterfy/Spotify/API.hs#L44-L55

elldritch commented 4 years ago

It looks like Text.URI is what I'm looking for.