haskell-servant / servant

Main repository for the servant libraries — DSL for describing, serving, querying, mocking, documenting web applications and more!
https://docs.servant.dev/
1.8k stars 407 forks source link

Support using the names from named routes in `servant-foreign` #1673

Open guaraqe opened 1 year ago

guaraqe commented 1 year ago

In many code generators one derives the name of the routes from their structure, such as getUsersByIdByGroup or something like that. It would be interesting if servant-foreign supported using the names coming from the routes when they are written as records when using NamedRoutes. That would allow for generated code that is easier to read and use.

For those who know the code, how big of a change would this be? Is there a precise point in the code where this name is chosen?