eskimor / servant-purescript

Translate servant API to purescript code, with the help of purescript-bridge.
BSD 3-Clause "New" or "Revised" License
105 stars 44 forks source link

fails with APIs with strings containing hiphens (servant-foreign-0.10 change) #31

Closed legrostdg closed 7 years ago

legrostdg commented 7 years ago

servant-foreign 0.10 avoids JavaScript specific mangling to the names. So, the code generated by servant-purescript will fail for APIs containing strings with hiphens.

eskimor commented 7 years ago

I am afraid, I don't fully understand the issue. Could you elaborate a bit?

legrostdg commented 7 years ago

if you have "/auto-update GET" in your API, servant-purescript used to generate "getAutoupdate", and now generates "getAuto-update", which is not valid. Note that this function name is valid in other languages, that's why the hyphen escaping/removal has been moved to servant-js. We should probably depend on "servant-js" instead of "servant-foreign", or copy the hyphen-escaping/removal logic in servant-purescript.

eskimor commented 7 years ago

I see. Thank you!