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

Clarify documentation for `Servant.Links.allLinks` #1751

Open danidiaz opened 2 months ago

danidiaz commented 2 months ago

The haddocks for allLinks have the following note:

nested APIs don't work well with this approach

and an example is given.

Does that mean that for nested APIs the links aren't correctly generated, or simply that the resulting "link builder" values like Char -> (Int -> Link) :<|> (Double -> Link) are unwieldly to use?

In the second case, perhaps it should be mentioned that allLinks still works when the nested APIs are represented with route records (video example here) and the ergonomics are better with records. Perhaps a doctest example could be given.