@@ -18,7 +18,7 @@ For example: `Range: createdAt 2017-01-15T23:14:67.000Z; offset 5; order desc` i
18
18
the client is willing to retrieve the next batch of document in descending order that were
19
19
created after the fifteenth of January, skipping the first 5.
20
20
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
22
22
response with 3 headers:
23
23
24
24
- `Accept-Ranges`: A comma-separated list of fields upon which a range can be defined
@@ -127,7 +127,7 @@ defaultRange =
127
127
getDefaultRange (Proxy @Color)
128
128
`` `
129
129
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
131
131
of the class. Yet, you can define `getRangeOptions` to provide different parsing options (see
132
132
the last section of this guide). In the meantime, we've also defined a `defaultRange` as it will
133
133
come in handy when defining our handler.
@@ -148,7 +148,7 @@ type MyHeaders =
148
148
`` `
149
149
150
150
`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:
152
152
153
153
`` ` haskell
154
154
-- type MyHeaders =
@@ -165,7 +165,7 @@ not, _servant-pagination_ provides an easy way to lift a collection of resources
165
165
#### Server
166
166
167
167
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`
169
169
header, looking for the format defined in introduction with fields and target types we have just declared.
170
170
If no such header is provided, we will end up receiving `Nothing`. Otherwise, it will be possible
171
171
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
192
192
- `Range: <field> [<value>][; offset <o>][; limit <l>][; order <asc|desc>]`
193
193
194
194
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
196
196
following examples are valid requests to send to our server:
197
197
198
198
- 1 - `curl http://localhost:1442/colors -vH 'Range: name' `
@@ -219,7 +219,7 @@ The previous ranges reads as follows:
219
219
Note that in the simple above scenario, there's no ambiguity with `extractRange` and `returnRange`
220
220
because there's only one possible `Range` defined on our resource. Yet, as you've most probably
221
221
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
223
223
highly likely to be needed.
224
224
225
225
@@ -235,8 +235,8 @@ instance HasPagination Color "hex" where
235
235
#### Parsing Options
236
236
237
237
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
240
240
specified (`limit`, `offset`, `order` are all optional) to provide default fallback values for those.
241
241
242
242
For instance, let's say we wanted to change the default limit to `5` in a new range on
0 commit comments