haskell-servant / haskell-servant/servant

Clarify documentation for `Servant.Links.allLinks`

Open
#1,751 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Haskell
Stars
2k
Forks
427
Avg merge
2d 23h
Merged PRs (30d)
5

Description

The haddocks for [`allLinks`](https://hackage.haskell.org/package/servant-0.20.1/docs/Servant-Links.html#v: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](https://youtu.be/KC64Ymo63hQ?t=146)) and the ergonomics are better with records. Perhaps a doctest example could be given.

Contributor guide

Open the contributing guide

Research direction

Start with the `allLinks` Haddock in `Servant-Links` and inspect the nested API example described in the issue. Clarify whether nested links are incorrect or merely awkward, and document the behavior, including route-record ergonomics or a doctest example if supported by the existing documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.