Skip to content

Commit ec80f25

Browse files
committed
Fixes issue #1206 by updating broken links in tutorial.
1 parent 6cf7c73 commit ec80f25

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

changelog.d/issue1206

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
synopsis: Fix broken links in Tutorial documentation.
2+
issues: #1206
3+
4+
description: {
5+
6+
In servant/doc/tutorial/Client.lhs, several links point to an .lhs file,
7+
which show as broken in the live web documentation. Changing the suffix to
8+
.html displays the correct documentation.
9+
10+
In servant/doc/tutorial/Authentication.lhs, a link to GHC documentation for
11+
Type Families pointed to a 404'd page. A link to existing GHC documentation
12+
was substituted.
13+
}

doc/tutorial/Authentication.lhs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ genAuthAPI = Proxy
318318
319319
Now we need to bring everything together for the server. We have the
320320
`AuthHandler Request Account` value and an `AuthProtected` endpoint. To bind these
321-
together, we need to provide a [Type Family](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/type-families.html)
321+
together, we need to provide a [Type Family](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#type-families)
322322
instance that tells the `HasServer` instance that our `Context` will supply a
323323
`Account` (via `AuthHandler Request Account`) and that downstream combinators will
324324
have access to this `Account` value (or an error will be thrown if authentication

doc/tutorial/Client.lhs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Querying an API
22

3-
While defining handlers that [serve an API](Server.lhs) has a lot to it, querying an API is simpler: we do not care about what happens inside the webserver, we just need to know how to talk to it and get a response back. That said, we usually have to write the querying functions by hand because the structure of the API isn't a first class citizen and can't be inspected to generate the client-side functions.
3+
While defining handlers that [serve an API](Server.html) has a lot to it, querying an API is simpler: we do not care about what happens inside the webserver, we just need to know how to talk to it and get a response back. That said, we usually have to write the querying functions by hand because the structure of the API isn't a first class citizen and can't be inspected to generate the client-side functions.
44

55
**servant** however has a way to inspect APIs, because APIs are just Haskell types and (GHC) Haskell lets us do quite a few things with types. In the same way that we look at an API type to deduce the types the handlers should have, we can inspect the structure of the API to *derive* Haskell functions that take one argument for each occurrence of `Capture`, `ReqBody`, `QueryParam`
6-
and friends (see [the tutorial introduction](ApiType.lhs) for an overview). By *derive*, we mean that there's no code generation involved - the functions are defined just by the structure of the API type.
6+
and friends (see [the tutorial introduction](ApiType.html) for an overview). By *derive*, we mean that there's no code generation involved - the functions are defined just by the structure of the API type.
77

88
The source for this tutorial section is a literate Haskell file, so first we need to have some language extensions and imports:
99

0 commit comments

Comments
 (0)