Skip to content

Commit b9d8fbc

Browse files
authored
Fix typos and grammar (#1304)
* Fix typos and grammar * Remove redundant words, fix articles * More language fixes * More typo fixes and resolve TODO about missing links
1 parent 67cb564 commit b9d8fbc

File tree

43 files changed

+83
-80
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+83
-80
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ the `news` label if you make a new package so we can know about it!
103103

104104
## Release policy
105105

106-
We are currently moving to a more aggresive release policy, so that you can get
106+
We are currently moving to a more aggressive release policy, so that you can get
107107
what you contribute from Hackage fairly soon. However, note that prior to major
108108
releases it may take some time in between releases.
109109

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ See `CONTRIBUTING.md`
3232
- It's a good idea to separate these steps, as tests often pass, if they compile :)
3333
- See `cabal.project` to selectively `allow-newer`
3434
- If some packages are broken, on your discretisation there are two options:
35-
- Fix them and make PRs: it's good idea to test against older `servant` version too.
35+
- Fix them and make PRs: it's a good idea to test against older `servant` version too.
3636
- Temporarily comment out broken package
3737
- If you make a commit for `servant-universe`, you can use it as submodule in private projects to test even more
3838
- When ripples are cleared out:
@@ -60,7 +60,7 @@ constraints:
6060
troublemaker <13.37 && > 13.37
6161
```
6262

63-
## TechEmpower framework bechmarks
63+
## TechEmpower framework benchmarks
6464

6565
We develop and maintain the servant TFB entry in https://github.com/haskell-servant/FrameworkBenchmarks/
6666

doc/cookbook/basic-streaming/Streaming.lhs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ In other words, without streaming libraries.
88
- Some basic usage doesn't require usage of streaming libraries,
99
like `conduit`, `pipes`, `machines` or `streaming`.
1010
We have bindings for them though.
11-
- This is similar example file, which is bundled with each of the packages (TODO: links)
11+
- Similar example is bundled with each of our streaming library interop packages (see
12+
[servant-pipes](https://github.com/haskell-servant/servant/blob/master/servant-pipes/example/Main.hs),
13+
[servant-conduit](https://github.com/haskell-servant/servant/blob/master/servant-conduit/example/Main.hs) and
14+
[servant-machines](https://github.com/haskell-servant/servant/blob/master/servant-machines/example/Main.hs))
1215
- `SourceT` doesn't have *Prelude* with handy combinators, so we have to write
1316
things ourselves. (Note to self: `mapM` and `foldM` would be handy to have).
1417

doc/cookbook/curl-mock/CurlMock.lhs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Generating mock curl calls
22

33
In this example we will generate curl requests with mock post data from a servant API.
4-
This may be usefull for testing and development purposes.
4+
This may be useful for testing and development purposes.
55
Especially post requests with a request body are tedious to send manually.
66

77
Also, we will learn how to use the servant-foreign library to generate stuff from servant APIs.

doc/cookbook/db-mysql-basics/MysqlBasics.lhs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This doc will walk through a single-module implementation of a servant API connecting to a MySQL database. It will also include some basic CRUD operations.
44

5-
Once you can wrap your head around this implemenation, understanding more complex features like resource pools would be beneficial next steps.
5+
Once you can wrap your head around this implementation, understanding more complex features like resource pools would be beneficial next steps.
66

77
The only *prerequisite* is that you have a MySQL database open on port 3306 of your machine. Docker is an easy way to manage this.
88

doc/cookbook/file-upload/FileUpload.lhs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ startServer = run 8080 (serve api upload)
9090
9191
Finally, a main function that brings up our server and
9292
sends some test request with `http-client` (and not
93-
servant-client this time, has servant-multipart does not
94-
yet have support for client generation.
93+
servant-client this time, as servant-multipart does not
94+
yet have support for client generation).
9595
9696
``` haskell
9797
main :: IO ()

doc/cookbook/generic/Generic.lhs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ api :: Proxy (ToServantApi Routes)
4343
api = genericApi (Proxy :: Proxy Routes)
4444
```
4545
46-
It's recommented to use `genericApi` function, as then you'll get
46+
It's recommended to use `genericApi` function, as then you'll get
4747
better error message, for example if you forget to `derive Generic`.
4848
4949
## Links
5050
5151
The clear advantage of record-based generics approach, is that
52-
we can get safe links very conviently. We don't need to define endpoint types,
52+
we can get safe links very conveniently. We don't need to define endpoint types,
5353
as field accessors work as proxies:
5454
5555
```haskell
@@ -67,7 +67,7 @@ routesLinks = allFieldLinks
6767
## Client
6868
6969
Even more power starts to show when we generate a record of client functions.
70-
Here we use `genericClientHoist` function, which let us simultaneously
70+
Here we use `genericClientHoist` function, which lets us simultaneously
7171
hoist the monad, in this case from `ClientM` to `IO`.
7272
7373
```haskell

doc/cookbook/hoist-server-with-context/HoistServerWithContext.lhs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ loginHandler cookieSettings jwtSettings form = do
254254
liftIO $ pushLogStrLn logset $ toLogStr logMsg
255255
throwError err401
256256
Just applyCookies -> do
257-
let successMsg = logMsg{message = "AdminUser succesfully authenticated!"}
257+
let successMsg = logMsg{message = "AdminUser successfully authenticated!"}
258258
liftIO $ pushLogStrLn logset $ toLogStr successMsg
259259
pure $ applyCookies successMsg
260260
loginHandler _ _ _ = throwError err401

doc/cookbook/open-id-connect/OpenIdConnect.lhs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ some login token would be saved in the user agent local storage.
88

99
Workflow:
1010

11-
1. user is presentend with a login button,
11+
1. user is presented with a login button,
1212
2. when the user click on the button it is redirected to the OIDC
1313
provider,
1414
3. the user login in the OIDC provider,
@@ -222,8 +222,8 @@ The `AuthInfo` is about the infos we can grab from OIDC provider.
222222
To be more precise, the user should come with a `code` (a token) and
223223
POSTing that code to the correct OIDC provider endpoint should return a JSON
224224
object. One of the field should be named `id_token` which should be a
225-
JWT containing all the informations we need. Depending on the scopes we
226-
asked we might get more informations.
225+
JWT containing all the information we need. Depending on the scopes we
226+
asked we might get more information.
227227
228228
``` haskell
229229
-- | @AuthInfo@
@@ -248,13 +248,13 @@ instance JSON.ToJSON AuthInfo where
248248
type LoginHandler = AuthInfo -> IO (Either Text User)
249249
```
250250
251-
The `handleLoggedIn` is that part that will retrieve the informations from
251+
The `handleLoggedIn` is that part that will retrieve the information from
252252
the user once he is redirected from the OIDC Provider after login.
253253
254254
If the user is redirected to the `redirect_uri` but with an `error` query
255255
parameter then it means something goes wrong.
256256
If there is no error query param but a `code` query param it means the user
257-
sucessfully logged in. From there we need to make a request to the token
257+
successfully logged in. From there we need to make a request to the token
258258
endpoint of the OIDC provider. Its a POST that should contains the code
259259
as well as the client id & secret.
260260
This is the role of the `requestTokens` to make this HTTP POST.
@@ -332,7 +332,7 @@ data Customer = Customer {
332332
Here is the code that display the homepage.
333333
It should contain a link to the the `/login` URL.
334334
When the user will click on this link it will be redirected to Google login page
335-
with some generated informations.
335+
with some generated information.
336336
337337
The page also display the content of the local storage.
338338
And in particular the items `api-key` and `user-id`.
@@ -366,7 +366,7 @@ instance ToMarkup Homepage where
366366
We need some helpers to generate random string for generating state and API Keys.
367367
368368
``` haskell
369-
-- | generate a random Bystestring, not necessarily extremely good randomness
369+
-- | generate a random ByteString, not necessarily extremely good randomness
370370
-- still the password will be long enough to be very difficult to crack
371371
genRandomBS :: IO ByteString
372372
genRandomBS = do

doc/cookbook/pagination/Pagination.lhs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ For example: `Range: createdAt 2017-01-15T23:14:67.000Z; offset 5; order desc` i
1818
the client is willing to retrieve the next batch of document in descending order that were
1919
created after the fifteenth of January, skipping the first 5.
2020

21-
As a response, the server may return the list of corresponding document, and augment the
21+
As a response, the server may return the list of corresponding documents, and augment the
2222
response with 3 headers:
2323

2424
- `Accept-Ranges`: A comma-separated list of fields upon which a range can be defined
@@ -127,7 +127,7 @@ defaultRange =
127127
getDefaultRange (Proxy @Color)
128128
```
129129
130-
Note that `getFieldValue :: Proxy "name" -> Color -> String` is the minimal complete definintion
130+
Note that `getFieldValue :: Proxy "name" -> Color -> String` is the minimal complete definition
131131
of the class. Yet, you can define `getRangeOptions` to provide different parsing options (see
132132
the last section of this guide). In the meantime, we've also defined a `defaultRange` as it will
133133
come in handy when defining our handler.
@@ -148,7 +148,7 @@ type MyHeaders =
148148
```
149149
150150
`PageHeaders` is a type alias provided by the library to declare the necessary response headers
151-
we mentionned in introduction. Expanding the alias boils down to the following:
151+
we mentioned in introduction. Expanding the alias boils down to the following:
152152
153153
``` haskell
154154
-- type MyHeaders =
@@ -165,7 +165,7 @@ not, _servant-pagination_ provides an easy way to lift a collection of resources
165165
#### Server
166166
167167
Time to connect the last bits by defining the server implementation of our colorful API. The `Ranges`
168-
type we've defined above (tight to the `Range` HTTP header) indicates the server to parse any `Range`
168+
type we've defined above (tied to the `Range` HTTP header) indicates the server to parse any `Range`
169169
header, looking for the format defined in introduction with fields and target types we have just declared.
170170
If no such header is provided, we will end up receiving `Nothing`. Otherwise, it will be possible
171171
to _extract_ a `Range` from our `Ranges`.
@@ -192,7 +192,7 @@ the format we defined, where `<field>` here can only be `name` and `<value>` mus
192192
- `Range: <field> [<value>][; offset <o>][; limit <l>][; order <asc|desc>]`
193193
194194
Beside the target field, everything is pretty much optional in the `Range` HTTP header. Missing parts
195-
are deducted from the `RangeOptions` that are part of the `HasPagination` instance. Therefore, all
195+
are deduced from the `RangeOptions` that are part of the `HasPagination` instance. Therefore, all
196196
following examples are valid requests to send to our server:
197197
198198
- 1 - `curl http://localhost:1442/colors -vH 'Range: name'`
@@ -219,7 +219,7 @@ The previous ranges reads as follows:
219219
Note that in the simple above scenario, there's no ambiguity with `extractRange` and `returnRange`
220220
because there's only one possible `Range` defined on our resource. Yet, as you've most probably
221221
noticed, the `Ranges` combinator accepts a list of fields, each of which must declare a `HasPagination`
222-
instance. Doing so will make the other helper functions more ambiguous and type annotation are
222+
instance. Doing so will make the other helper functions more ambiguous and type annotations are
223223
highly likely to be needed.
224224
225225
@@ -235,8 +235,8 @@ instance HasPagination Color "hex" where
235235
#### Parsing Options
236236
237237
By default, `servant-pagination` provides an implementation of `getRangeOptions` for each
238-
`HasPagination` instance. However, this can be overwritten when defining the instance to provide
239-
your own options. This options come into play when a `Range` header is received and isn't fully
238+
`HasPagination` instance. However, this can be overridden when defining the instance to provide
239+
your own options. These options come into play when a `Range` header is received and isn't fully
240240
specified (`limit`, `offset`, `order` are all optional) to provide default fallback values for those.
241241
242242
For instance, let's say we wanted to change the default limit to `5` in a new range on

0 commit comments

Comments
 (0)